10421 | 2024-04-02 00:13:35 | 111 | Felhasználónevek | cpp17 | Wrong answer 60/100 | 277ms | 35736 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.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 | 1828 KiB | ||||
2 | Accepted | 3ms | 2052 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 3ms | 2248 KiB | ||||
4 | Accepted | 3ms | 2388 KiB | ||||
subtask3 | 40/40 | ||||||
5 | Accepted | 2ms | 2388 KiB | ||||
6 | Accepted | 3ms | 2616 KiB | ||||
7 | Accepted | 3ms | 2836 KiB | ||||
8 | Accepted | 3ms | 3056 KiB | ||||
9 | Accepted | 3ms | 3256 KiB | ||||
10 | Accepted | 3ms | 3408 KiB | ||||
11 | Accepted | 3ms | 3488 KiB | ||||
12 | Accepted | 3ms | 3484 KiB | ||||
13 | Accepted | 3ms | 3756 KiB | ||||
14 | Accepted | 3ms | 3828 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 192ms | 35068 KiB | ||||
16 | Accepted | 214ms | 35084 KiB | ||||
17 | Accepted | 210ms | 35076 KiB | ||||
18 | Accepted | 214ms | 35140 KiB | ||||
19 | Accepted | 272ms | 35148 KiB | ||||
20 | Accepted | 273ms | 35144 KiB | ||||
21 | Accepted | 247ms | 35392 KiB | ||||
22 | Accepted | 277ms | 35604 KiB | ||||
23 | Accepted | 93ms | 19852 KiB | ||||
24 | Accepted | 93ms | 20188 KiB | ||||
25 | Accepted | 114ms | 23224 KiB | ||||
26 | Accepted | 90ms | 19616 KiB | ||||
27 | Wrong answer | 275ms | 35736 KiB |