提出 #73476445


ソースコード 拡げる

#include <algorithm>
#include <iostream>
#include <map>
//#include <numeric>
#include <queue>
//#include <ranges>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define pb push_back
#define fr first
#define sc second
#define sor(v) sort(v.begin(), v.end())
#define rev(v) reverse(v.begin(), v.end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using pint = pair<int,int>;
//using pll = pair<ll,ll>;
//using pqdec = priority_queue<int,vector<int>,greater<int>>;
//using pqdecl = priority_queue<ll,vector<ll>,greater<ll>>;
template <typename T>
using graph = vector<vector<T>>;
const ll LLMAX = 9223372*1e10;
const int IMAX = 214*1e7;
/*--------考察--------------------
----------CODING----------------*/
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,m; cin >> n >> m;
    vector<bool> v(m+1,true);
    rep(i,n){
        int l; cin >> l;
        int dr = 0;
        
            bool ok = false;
        rep(j,l){
            int a; cin >> a;
            if(ok) continue;
            if(v[a]){
                v[a] = false;
                dr = a;
                ok = true;
            }
        }
        cout << dr << endl;
    }
}

提出情報

提出日時
問題 B - Greedy Draft
ユーザ scotch_at
言語 C++23 (GCC 15.2.0)
得点 200
コード長 1302 Byte
結果 AC
実行時間 1 ms
メモリ 3640 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 20
セット名 テストケース
Sample 00-sample-01.txt, 00-sample-02.txt
All 00-sample-01.txt, 00-sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt
ケース名 結果 実行時間 メモリ
00-sample-01.txt AC 1 ms 3536 KiB
00-sample-02.txt AC 1 ms 3460 KiB
01-01.txt AC 1 ms 3460 KiB
01-02.txt AC 1 ms 3576 KiB
01-03.txt AC 1 ms 3576 KiB
01-04.txt AC 1 ms 3452 KiB
01-05.txt AC 1 ms 3584 KiB
01-06.txt AC 1 ms 3460 KiB
01-07.txt AC 1 ms 3528 KiB
01-08.txt AC 1 ms 3448 KiB
01-09.txt AC 1 ms 3640 KiB
01-10.txt AC 1 ms 3448 KiB
01-11.txt AC 1 ms 3640 KiB
01-12.txt AC 1 ms 3420 KiB
01-13.txt AC 1 ms 3536 KiB
01-14.txt AC 1 ms 3536 KiB
01-15.txt AC 1 ms 3460 KiB
01-16.txt AC 1 ms 3528 KiB
01-17.txt AC 1 ms 3416 KiB
01-18.txt AC 1 ms 3640 KiB