122722024-12-10 22:00:29CsongiFelhasználónevekcpp17Wrong answer 20/10019ms624 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms320 KiB
2Wrong answer1ms500 KiB
subtask220/20
3Accepted1ms320 KiB
4Accepted1ms320 KiB
subtask30/40
5Accepted1ms320 KiB
6Accepted1ms320 KiB
7Wrong answer1ms320 KiB
8Wrong answer1ms320 KiB
9Wrong answer1ms320 KiB
10Wrong answer1ms344 KiB
11Wrong answer1ms320 KiB
12Wrong answer1ms320 KiB
13Wrong answer1ms320 KiB
14Wrong answer1ms320 KiB
subtask40/40
15Accepted18ms424 KiB
16Accepted18ms508 KiB
17Wrong answer18ms320 KiB
18Wrong answer18ms428 KiB
19Wrong answer18ms320 KiB
20Wrong answer19ms508 KiB
21Wrong answer19ms624 KiB
22Wrong answer19ms320 KiB
23Wrong answer17ms432 KiB
24Wrong answer17ms424 KiB
25Wrong answer17ms320 KiB
26Wrong answer17ms424 KiB
27Accepted18ms424 KiB