10418 | 2024-04-01 23:59:35 | 111 | Felhasználónevek | cpp17 | Runtime error 20/100 | 187ms | 23456 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{
s.insert(stoi(z.substr(S.size())));
}
}
}
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 | 1828 KiB | ||||
2 | Accepted | 3ms | 2052 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 3ms | 2400 KiB | ||||
4 | Accepted | 3ms | 2648 KiB | ||||
subtask3 | 0/40 | ||||||
5 | Accepted | 3ms | 2744 KiB | ||||
6 | Accepted | 3ms | 2952 KiB | ||||
7 | Accepted | 3ms | 3040 KiB | ||||
8 | Accepted | 3ms | 3044 KiB | ||||
9 | Accepted | 3ms | 3132 KiB | ||||
10 | Accepted | 3ms | 3348 KiB | ||||
11 | Accepted | 3ms | 3352 KiB | ||||
12 | Accepted | 3ms | 3460 KiB | ||||
13 | Runtime error | 4ms | 4340 KiB | ||||
14 | Runtime error | 4ms | 4448 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 140ms | 22624 KiB | ||||
16 | Accepted | 148ms | 22876 KiB | ||||
17 | Accepted | 133ms | 22924 KiB | ||||
18 | Accepted | 157ms | 23024 KiB | ||||
19 | Accepted | 187ms | 22952 KiB | ||||
20 | Accepted | 157ms | 22940 KiB | ||||
21 | Accepted | 158ms | 22988 KiB | ||||
22 | Accepted | 171ms | 22980 KiB | ||||
23 | Runtime error | 4ms | 4660 KiB | ||||
24 | Runtime error | 4ms | 4684 KiB | ||||
25 | Runtime error | 4ms | 4812 KiB | ||||
26 | Runtime error | 4ms | 4712 KiB | ||||
27 | Wrong answer | 158ms | 23456 KiB |