12272 | 2024-12-10 22:00:29 | Csongi | Felhasználónevek | cpp17 | Wrong answer 20/100 | 19ms | 624 KiB |
#include <bits/stdc++.h>
#define ll long long
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;
for (int i = 0; i < n; i++)
{
cin >> x;
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 | 500 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 1ms | 320 KiB | ||||
4 | Accepted | 1ms | 320 KiB | ||||
subtask3 | 0/40 | ||||||
5 | Accepted | 1ms | 320 KiB | ||||
6 | Accepted | 1ms | 320 KiB | ||||
7 | Wrong answer | 1ms | 320 KiB | ||||
8 | Wrong answer | 1ms | 320 KiB | ||||
9 | Wrong answer | 1ms | 320 KiB | ||||
10 | Wrong answer | 1ms | 344 KiB | ||||
11 | Wrong answer | 1ms | 320 KiB | ||||
12 | Wrong answer | 1ms | 320 KiB | ||||
13 | Wrong answer | 1ms | 320 KiB | ||||
14 | Wrong answer | 1ms | 320 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 18ms | 424 KiB | ||||
16 | Accepted | 18ms | 508 KiB | ||||
17 | Wrong answer | 18ms | 320 KiB | ||||
18 | Wrong answer | 18ms | 428 KiB | ||||
19 | Wrong answer | 18ms | 320 KiB | ||||
20 | Wrong answer | 19ms | 508 KiB | ||||
21 | Wrong answer | 19ms | 624 KiB | ||||
22 | Wrong answer | 19ms | 320 KiB | ||||
23 | Wrong answer | 17ms | 432 KiB | ||||
24 | Wrong answer | 17ms | 424 KiB | ||||
25 | Wrong answer | 17ms | 320 KiB | ||||
26 | Wrong answer | 17ms | 424 KiB | ||||
27 | Accepted | 18ms | 424 KiB |