10423 | 2024-04-02 00:20:44 | 111 | Felhasználónevek | cpp17 | Wrong answer 60/100 | 282ms | 35280 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<string>s;
for(int i=0;i<N;i++){
string z;
cin>>z;
if(z.size()>=S.size()&&z.size()<30&&z.substr(0,S.size())==S){
if(z.size()==S.size()){
s.insert("0");
}
else{
string zz=z.substr(S.size());
s.insert(zz);
}
}
}
int i=0;
while(s.count(to_string(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 | 1824 KiB | ||||
2 | Accepted | 3ms | 2192 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 3ms | 2336 KiB | ||||
4 | Accepted | 3ms | 2424 KiB | ||||
subtask3 | 40/40 | ||||||
5 | Accepted | 3ms | 2668 KiB | ||||
6 | Accepted | 3ms | 2816 KiB | ||||
7 | Accepted | 2ms | 2864 KiB | ||||
8 | Accepted | 3ms | 2944 KiB | ||||
9 | Accepted | 3ms | 3036 KiB | ||||
10 | Accepted | 3ms | 3256 KiB | ||||
11 | Accepted | 2ms | 3244 KiB | ||||
12 | Accepted | 3ms | 3244 KiB | ||||
13 | Accepted | 3ms | 3328 KiB | ||||
14 | Accepted | 2ms | 3236 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 194ms | 34608 KiB | ||||
16 | Accepted | 192ms | 34576 KiB | ||||
17 | Accepted | 193ms | 34584 KiB | ||||
18 | Accepted | 216ms | 34888 KiB | ||||
19 | Accepted | 246ms | 34908 KiB | ||||
20 | Accepted | 254ms | 34848 KiB | ||||
21 | Accepted | 282ms | 35156 KiB | ||||
22 | Accepted | 256ms | 35176 KiB | ||||
23 | Accepted | 96ms | 18988 KiB | ||||
24 | Accepted | 96ms | 19384 KiB | ||||
25 | Accepted | 112ms | 22288 KiB | ||||
26 | Accepted | 93ms | 18948 KiB | ||||
27 | Wrong answer | 270ms | 35280 KiB |