10420 | 2024-04-02 00:09:36 | 111 | Felhasználónevek | cpp17 | Wrong answer 20/100 | 155ms | 22472 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());
int x=0;
for(char c:zz){
if(x>1000000||!isdigit(c)){
x=-1;
break;
}
x*=10;
x+=c-'0';
}
s.insert(x);
}
}
}
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 | 2100 KiB | ||||
2 | Accepted | 3ms | 2152 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 3ms | 2356 KiB | ||||
4 | Accepted | 3ms | 2596 KiB | ||||
subtask3 | 0/40 | ||||||
5 | Accepted | 3ms | 2716 KiB | ||||
6 | Accepted | 3ms | 2776 KiB | ||||
7 | Accepted | 3ms | 2908 KiB | ||||
8 | Accepted | 3ms | 3184 KiB | ||||
9 | Accepted | 3ms | 3052 KiB | ||||
10 | Accepted | 3ms | 3296 KiB | ||||
11 | Accepted | 3ms | 3312 KiB | ||||
12 | Accepted | 2ms | 3280 KiB | ||||
13 | Wrong answer | 2ms | 3268 KiB | ||||
14 | Wrong answer | 2ms | 3308 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 122ms | 22028 KiB | ||||
16 | Accepted | 119ms | 22032 KiB | ||||
17 | Accepted | 120ms | 22024 KiB | ||||
18 | Accepted | 128ms | 22024 KiB | ||||
19 | Accepted | 143ms | 22080 KiB | ||||
20 | Accepted | 145ms | 22372 KiB | ||||
21 | Accepted | 143ms | 22324 KiB | ||||
22 | Accepted | 155ms | 22328 KiB | ||||
23 | Wrong answer | 46ms | 7448 KiB | ||||
24 | Wrong answer | 46ms | 7708 KiB | ||||
25 | Wrong answer | 46ms | 7740 KiB | ||||
26 | Wrong answer | 46ms | 7652 KiB | ||||
27 | Wrong answer | 144ms | 22472 KiB |