12276 | 2024-12-10 22:07:05 | Csongi | Felhasználónevek | cpp17 | Time limit exceeded 60/100 | 1.101s | 22328 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;
set<string> f;
for (int i = 0; i < n; i++)
{
cin >> x;
if (x == valerio)
{
t = true;
}
f.insert(x);
}
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 | 508 KiB | ||||
2 | Accepted | 1ms | 320 KiB | ||||
subtask2 | 20/20 | ||||||
3 | Accepted | 1ms | 320 KiB | ||||
4 | Accepted | 1ms | 320 KiB | ||||
subtask3 | 40/40 | ||||||
5 | Accepted | 1ms | 320 KiB | ||||
6 | Accepted | 1ms | 508 KiB | ||||
7 | Accepted | 1ms | 320 KiB | ||||
8 | Accepted | 1ms | 320 KiB | ||||
9 | Accepted | 1ms | 512 KiB | ||||
10 | Accepted | 1ms | 320 KiB | ||||
11 | Accepted | 1ms | 320 KiB | ||||
12 | Accepted | 1ms | 320 KiB | ||||
13 | Accepted | 1ms | 500 KiB | ||||
14 | Accepted | 1ms | 516 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 270ms | 22136 KiB | ||||
16 | Accepted | 326ms | 22296 KiB | ||||
17 | Accepted | 270ms | 22324 KiB | ||||
18 | Time limit exceeded | 1.101s | 22328 KiB | ||||
19 | Time limit exceeded | 1.083s | 22328 KiB | ||||
20 | Time limit exceeded | 1.082s | 22328 KiB | ||||
21 | Time limit exceeded | 1.085s | 22328 KiB | ||||
22 | Time limit exceeded | 1.083s | 22328 KiB | ||||
23 | Time limit exceeded | 1.08s | 15672 KiB | ||||
24 | Time limit exceeded | 1.08s | 15736 KiB | ||||
25 | Time limit exceeded | 1.083s | 15416 KiB | ||||
26 | Time limit exceeded | 1.09s | 15416 KiB | ||||
27 | Accepted | 236ms | 22328 KiB |