17272022-12-02 09:51:46bzsofiaKéséscpp11Accepted 50/50223ms25676 KiB
#include <iostream>
#include <map>
#include <vector>

using namespace std;

map<long long, int> x;
long long ev;
int n, i;

int main()
{
    cin>>n;

    vector <bool> jo(n+1);

    for (i=1; i<=n; ++i)
    {
        cin>>ev;

        if (x[ev]>0) jo[x[ev]]=1;

        x[ev]=i;
    }

    i=1;
    while (jo[i]) ++i;

    cout<<i;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1820 KiB
2Accepted0/014ms3112 KiB
3Accepted5/53ms2428 KiB
4Accepted5/53ms2344 KiB
5Accepted5/597ms2440 KiB
6Accepted5/598ms2884 KiB
7Accepted4/4188ms18528 KiB
8Accepted4/4187ms18172 KiB
9Accepted4/4182ms15916 KiB
10Accepted4/4180ms14480 KiB
11Accepted4/4180ms13264 KiB
12Accepted2/2201ms13944 KiB
13Accepted2/2223ms25676 KiB
14Accepted1/1222ms25320 KiB
15Accepted1/1221ms24956 KiB
16Accepted1/1210ms20912 KiB
17Accepted1/1206ms15420 KiB
18Accepted1/1168ms4740 KiB
19Accepted1/1160ms4364 KiB