12278 | 2024-12-10 22:12:01 | Csongi | Felhasználónevek | cpp17 | Wrong answer 0/100 | 46ms | 16116 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string valerio; cin >> valerio;
int n, k = 1; bool t = false; cin >> n;
string x;
vector<string> f(n);
for (int i = 0; i < n; i++)
{
cin >> f[i];
if (x == valerio)
{
t = true;
}
}
if (!t)
{
cout << valerio << endl; return 0;
}
sort(f.begin(), f.end());
while (find(f.begin(), f.end(), valerio+to_string(k)) != f.end())
{
k++;
}
cout << valerio+to_string(k) << endl;
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 1ms | 320 KiB | ||||
2 | Wrong answer | 1ms | 320 KiB | ||||
subtask2 | 0/20 | ||||||
3 | Accepted | 1ms | 320 KiB | ||||
4 | Wrong answer | 1ms | 320 KiB | ||||
subtask3 | 0/40 | ||||||
5 | Accepted | 1ms | 320 KiB | ||||
6 | Wrong answer | 1ms | 320 KiB | ||||
7 | Wrong answer | 1ms | 324 KiB | ||||
8 | Wrong answer | 1ms | 336 KiB | ||||
9 | Wrong answer | 1ms | 320 KiB | ||||
10 | Wrong answer | 1ms | 392 KiB | ||||
11 | Wrong answer | 1ms | 512 KiB | ||||
12 | Wrong answer | 1ms | 320 KiB | ||||
13 | Wrong answer | 1ms | 508 KiB | ||||
14 | Wrong answer | 1ms | 320 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 43ms | 16056 KiB | ||||
16 | Wrong answer | 43ms | 16056 KiB | ||||
17 | Wrong answer | 46ms | 15928 KiB | ||||
18 | Wrong answer | 46ms | 15932 KiB | ||||
19 | Wrong answer | 46ms | 15956 KiB | ||||
20 | Wrong answer | 46ms | 16116 KiB | ||||
21 | Wrong answer | 43ms | 15844 KiB | ||||
22 | Wrong answer | 43ms | 15928 KiB | ||||
23 | Wrong answer | 27ms | 7224 KiB | ||||
24 | Wrong answer | 26ms | 7224 KiB | ||||
25 | Wrong answer | 27ms | 7224 KiB | ||||
26 | Wrong answer | 25ms | 7228 KiB | ||||
27 | Accepted | 43ms | 16076 KiB |