10422 | 2024-04-02 00:14:38 | 111 | Felhasználónevek | cpp17 | Wrong answer 60/100 | 250ms | 34688 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.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 | 2056 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 2ms | 2140 KiB | ||||
4 | Accepted | 3ms | 2272 KiB | ||||
subtask3 | 40/40 | ||||||
5 | Accepted | 3ms | 2464 KiB | ||||
6 | Accepted | 3ms | 2424 KiB | ||||
7 | Accepted | 3ms | 2420 KiB | ||||
8 | Accepted | 3ms | 2648 KiB | ||||
9 | Accepted | 3ms | 3008 KiB | ||||
10 | Accepted | 3ms | 2956 KiB | ||||
11 | Accepted | 3ms | 3036 KiB | ||||
12 | Accepted | 3ms | 3168 KiB | ||||
13 | Accepted | 2ms | 3240 KiB | ||||
14 | Accepted | 2ms | 3324 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 217ms | 34460 KiB | ||||
16 | Accepted | 187ms | 34516 KiB | ||||
17 | Accepted | 188ms | 34376 KiB | ||||
18 | Accepted | 209ms | 34376 KiB | ||||
19 | Accepted | 244ms | 34372 KiB | ||||
20 | Accepted | 250ms | 34688 KiB | ||||
21 | Accepted | 247ms | 34644 KiB | ||||
22 | Accepted | 247ms | 34656 KiB | ||||
23 | Accepted | 90ms | 18584 KiB | ||||
24 | Accepted | 92ms | 18812 KiB | ||||
25 | Accepted | 105ms | 21996 KiB | ||||
26 | Accepted | 90ms | 18264 KiB | ||||
27 | Wrong answer | 245ms | 34596 KiB |