Submission #73474073
Source Code Expand
// Problem: B - Greedy Draft
// Contest: AtCoder - AtCoder Beginner Contest 446
// URL: https://atcoder.jp/contests/abc446/tasks/abc446_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// writen by slightar
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define more int _;cin>>_;while(_--)
#define close ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define coutyes cout<<"Yes\n";
#define coutno cout<<"No\n";
#define all(A) A.begin(),A.end()
#define point pair<int,int>
#define x first
#define y second
const int mod=1e9+7,N=2e5+8;
int n,m,ans,cnt,k,l,r,a[N];
void solve(){
cin>>n>>m;
vector<int>b(m+2,0);
for(int i=1;i<=n;i++){
cin>>a[i];
bool f=0;
for(int j=1;j<=a[i];j++){
int t;cin>>t;
if(f)continue;
if(!b[t]){
cout<<t<<"\n";
b[t]=1;f=1;
}
}
if(!f)cout<<"0\n";
}
}
signed main(){
close
solve();
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Greedy Draft |
| User | star_1 |
| Language | C++23 (Clang 21.1.0) |
| Score | 200 |
| Code Size | 912 Byte |
| Status | AC |
| Exec Time | 3 ms |
| Memory | 3112 KiB |
Compile Error
./Main.cpp:19:11: warning: unused variable 'mod' [-Wunused-const-variable]
19 | const int mod=1e9+7,N=2e5+8;
| ^~~
1 warning generated.
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 | 2 ms | 3024 KiB |
| 00-sample-02.txt | AC | 1 ms | 2996 KiB |
| 01-01.txt | AC | 1 ms | 2996 KiB |
| 01-02.txt | AC | 1 ms | 2892 KiB |
| 01-03.txt | AC | 1 ms | 3004 KiB |
| 01-04.txt | AC | 2 ms | 3096 KiB |
| 01-05.txt | AC | 2 ms | 2984 KiB |
| 01-06.txt | AC | 2 ms | 3020 KiB |
| 01-07.txt | AC | 1 ms | 3112 KiB |
| 01-08.txt | AC | 3 ms | 3096 KiB |
| 01-09.txt | AC | 1 ms | 3016 KiB |
| 01-10.txt | AC | 1 ms | 2944 KiB |
| 01-11.txt | AC | 1 ms | 2880 KiB |
| 01-12.txt | AC | 2 ms | 3020 KiB |
| 01-13.txt | AC | 2 ms | 3112 KiB |
| 01-14.txt | AC | 2 ms | 2924 KiB |
| 01-15.txt | AC | 2 ms | 3052 KiB |
| 01-16.txt | AC | 1 ms | 2924 KiB |
| 01-17.txt | AC | 1 ms | 3016 KiB |
| 01-18.txt | AC | 1 ms | 2924 KiB |