12279 | 2024-12-10 22:12:45 | Csongi | Felhasználónevek | cpp17 | Time limit exceeded 60/100 | 1.1s | 16004 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;
vector<string> f(n);
for (int i = 0; i < n; i++)
{
cin >> f[i];
if (f[i] == 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 | 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 | 320 KiB | ||||
7 | Accepted | 1ms | 608 KiB | ||||
8 | Accepted | 1ms | 320 KiB | ||||
9 | Accepted | 1ms | 320 KiB | ||||
10 | Accepted | 1ms | 320 KiB | ||||
11 | Accepted | 1ms | 320 KiB | ||||
12 | Accepted | 1ms | 320 KiB | ||||
13 | Accepted | 1ms | 320 KiB | ||||
14 | Accepted | 1ms | 320 KiB | ||||
subtask4 | 0/40 | ||||||
15 | Accepted | 45ms | 16000 KiB | ||||
16 | Accepted | 165ms | 16004 KiB | ||||
17 | Accepted | 165ms | 15996 KiB | ||||
18 | Time limit exceeded | 1.1s | 16000 KiB | ||||
19 | Time limit exceeded | 1.093s | 15928 KiB | ||||
20 | Time limit exceeded | 1.082s | 15928 KiB | ||||
21 | Time limit exceeded | 1.082s | 15928 KiB | ||||
22 | Time limit exceeded | 1.083s | 15928 KiB | ||||
23 | Time limit exceeded | 1.082s | 7088 KiB | ||||
24 | Time limit exceeded | 1.072s | 7224 KiB | ||||
25 | Time limit exceeded | 1.072s | 7188 KiB | ||||
26 | Time limit exceeded | 1.087s | 6968 KiB | ||||
27 | Accepted | 43ms | 15928 KiB |