28872023-02-01 19:07:32UnluckYKéséscpp11Accepted 50/50303ms39104 KiB
#include <bits/stdc++.h>

using namespace std;

int main(){

    int n; cin >> n;

    vector<int> v; set<int> ss, s;

    for (int i = 0; i < n; i++){
        int x; cin >> x;
        v.push_back(x);
        ss.insert(x);
    }

    for (int i = n-1; i >= 0; i--){
        s.insert(v[i]);
        if (s.size() == ss.size()){
            cout << i+1;
            break;
        }
    }


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1956 KiB
2Accepted0/014ms3752 KiB
3Accepted5/53ms2416 KiB
4Accepted5/53ms2616 KiB
5Accepted5/564ms4744 KiB
6Accepted5/564ms5048 KiB
7Accepted4/4204ms28112 KiB
8Accepted4/4201ms27928 KiB
9Accepted4/4185ms24756 KiB
10Accepted4/4172ms22452 KiB
11Accepted4/4170ms19980 KiB
12Accepted2/2206ms21300 KiB
13Accepted2/2280ms39104 KiB
14Accepted1/1303ms38460 KiB
15Accepted1/1264ms37772 KiB
16Accepted1/1245ms31324 KiB
17Accepted1/1189ms23240 KiB
18Accepted1/1129ms7424 KiB
19Accepted1/1119ms6876 KiB