38762023-03-03 12:53:45ZsofiaKeresztelyKéséscpp14Accepted 50/50203ms22196 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, op=n;
    cin >> n;
    vector<int> a(n);
    for (int &x : a){
        cin >> x;
    }
    map<int, int> m;
    for (int i=n-1; i>=0; i--){
        if (!m[a[i]]) op = i+1;
        m[a[i]]++;
    }
    cout << op;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1816 KiB
2Accepted0/014ms3052 KiB
3Accepted5/53ms2292 KiB
4Accepted5/53ms2500 KiB
5Accepted5/583ms4116 KiB
6Accepted5/582ms4080 KiB
7Accepted4/4165ms16340 KiB
8Accepted4/4165ms16028 KiB
9Accepted4/4160ms14700 KiB
10Accepted4/4158ms13700 KiB
11Accepted4/4155ms12624 KiB
12Accepted2/2179ms13232 KiB
13Accepted2/2203ms22180 KiB
14Accepted1/1203ms22196 KiB
15Accepted1/1201ms21676 KiB
16Accepted1/1193ms18812 KiB
17Accepted1/1181ms14732 KiB
18Accepted1/1143ms7032 KiB
19Accepted1/1136ms6448 KiB