122782024-12-10 22:12:01CsongiFelhasználónevekcpp17Wrong answer 0/10046ms16116 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms320 KiB
2Wrong answer1ms320 KiB
subtask20/20
3Accepted1ms320 KiB
4Wrong answer1ms320 KiB
subtask30/40
5Accepted1ms320 KiB
6Wrong answer1ms320 KiB
7Wrong answer1ms324 KiB
8Wrong answer1ms336 KiB
9Wrong answer1ms320 KiB
10Wrong answer1ms392 KiB
11Wrong answer1ms512 KiB
12Wrong answer1ms320 KiB
13Wrong answer1ms508 KiB
14Wrong answer1ms320 KiB
subtask40/40
15Accepted43ms16056 KiB
16Wrong answer43ms16056 KiB
17Wrong answer46ms15928 KiB
18Wrong answer46ms15932 KiB
19Wrong answer46ms15956 KiB
20Wrong answer46ms16116 KiB
21Wrong answer43ms15844 KiB
22Wrong answer43ms15928 KiB
23Wrong answer27ms7224 KiB
24Wrong answer26ms7224 KiB
25Wrong answer27ms7224 KiB
26Wrong answer25ms7228 KiB
27Accepted43ms16076 KiB