Submission #73479072
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
struct Init { Init() { ios::sync_with_stdio(0); cin.tie(0); cout << setprecision(13); } }init;
using ll = long long;
using pll = pair<ll, ll>;
const int inf = 1073741823;
const long long INF = 1LL << 60;
#define el '\n'
#define spa " "
#define pb emplace_back
#define rep(i, s, n) for(int i = (s); i < (int)(n); i++)
#define rrep(i, s, n) for(int i = (int)(n) - 1; i >= (s); i--)
#define Yes cout << "Yes" << el
#define No cout << "No" << el
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define unless(c) if(!(c))
#define until(c) while(!(c))
int sub(){
return 0;
}
int solve() {
int n, m;
cin >> n >> m;
set<int> d;
rep(i, 0, n){
int l;
cin >> l;
bool wa = false;
rep(i, 0, l){
int a;
cin >> a;
if(d.find(a) == d.end() and !wa){
d.insert(a);
cout << a << el;
wa = true;
}
}
if(!wa){
cout << 0 << el;
}
}
return 0;
}
int main() {
int t = 1;
// cin >> t;
rep(i, 0, t) {
solve();
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Greedy Draft |
| User | tuttutu256 |
| Language | C++23 (GCC 15.2.0) |
| Score | 200 |
| Code Size | 1241 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3656 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| 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 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-01.txt | AC | 1 ms | 3608 KiB |
| 00-sample-02.txt | AC | 1 ms | 3468 KiB |
| 01-01.txt | AC | 1 ms | 3536 KiB |
| 01-02.txt | AC | 1 ms | 3468 KiB |
| 01-03.txt | AC | 1 ms | 3484 KiB |
| 01-04.txt | AC | 1 ms | 3484 KiB |
| 01-05.txt | AC | 1 ms | 3484 KiB |
| 01-06.txt | AC | 1 ms | 3608 KiB |
| 01-07.txt | AC | 1 ms | 3500 KiB |
| 01-08.txt | AC | 1 ms | 3608 KiB |
| 01-09.txt | AC | 1 ms | 3620 KiB |
| 01-10.txt | AC | 1 ms | 3440 KiB |
| 01-11.txt | AC | 1 ms | 3656 KiB |
| 01-12.txt | AC | 1 ms | 3500 KiB |
| 01-13.txt | AC | 1 ms | 3608 KiB |
| 01-14.txt | AC | 1 ms | 3600 KiB |
| 01-15.txt | AC | 1 ms | 3576 KiB |
| 01-16.txt | AC | 1 ms | 3540 KiB |
| 01-17.txt | AC | 1 ms | 3428 KiB |
| 01-18.txt | AC | 1 ms | 3576 KiB |