10419 | 2024-04-02 00:04:27 | 111 | Felhasználónevek | cpp17 | Wrong answer 20/100 | 217ms | 23256 KiB |
#include <bits/stdc++.h>
using namespace std;
// #define int long long
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
string S;
cin>>S;
int N;
cin>>N;
set<int>s;
for(int i=0;i<N;i++){
string z;
cin>>z;
if(z.substr(0,S.size())==S){
if(z.size()==S.size()){
s.insert(0);
}
else{
string zz=z.substr(S.size())+" 1";
int y,yy;
int x=sscanf(zz.data(),"%i %i",&y,&yy);
if(x==2)s.insert(y);
}
}
}
int i=0;
while(s.count(i)){
i++;
}
if(i){
S+=to_string(i);
}
cout<<S<<'\n';
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1736 KiB | ||||
2 | Accepted | 3ms | 1968 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 3ms | 2092 KiB | ||||
4 | Accepted | 3ms | 2300 KiB | ||||
subtask3 | 0/40 | ||||||
5 | Accepted | 3ms | 2524 KiB | ||||
6 | Accepted | 3ms | 2724 KiB | ||||
7 | Accepted | 3ms | 2940 KiB | ||||
8 | Accepted | 3ms | 3132 KiB | ||||
9 | Accepted | 3ms | 3328 KiB | ||||
10 | Accepted | 3ms | 3544 KiB | ||||
11 | Accepted | 3ms | 3768 KiB | ||||
12 | Accepted | 3ms | 3852 KiB | ||||
13 | Wrong answer | 3ms | 3836 KiB | ||||
14 | Wrong answer | 3ms | 3972 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 187ms | 22800 KiB | ||||
16 | Accepted | 187ms | 22968 KiB | ||||
17 | Accepted | 188ms | 23056 KiB | ||||
18 | Accepted | 189ms | 23052 KiB | ||||
19 | Accepted | 210ms | 23148 KiB | ||||
20 | Accepted | 216ms | 23196 KiB | ||||
21 | Accepted | 217ms | 23256 KiB | ||||
22 | Accepted | 204ms | 23012 KiB | ||||
23 | Accepted | 61ms | 7208 KiB | ||||
24 | Accepted | 63ms | 7444 KiB | ||||
25 | Wrong answer | 64ms | 7124 KiB | ||||
26 | Wrong answer | 59ms | 7116 KiB | ||||
27 | Wrong answer | 201ms | 22996 KiB |