28862023-02-01 19:04:36UnluckYKéséscpp11Wrong answer 0/50268ms39036 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 << n-i-1;
            break;
        }
    }


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/03ms1808 KiB
2Wrong answer0/014ms3800 KiB
3Wrong answer0/53ms2484 KiB
4Wrong answer0/53ms2424 KiB
5Wrong answer0/567ms4484 KiB
6Wrong answer0/567ms4712 KiB
7Wrong answer0/4203ms27656 KiB
8Wrong answer0/4200ms27204 KiB
9Wrong answer0/4184ms24380 KiB
10Wrong answer0/4167ms22032 KiB
11Wrong answer0/4158ms19488 KiB
12Wrong answer0/2200ms21000 KiB
13Wrong answer0/2268ms39036 KiB
14Wrong answer0/1254ms38544 KiB
15Wrong answer0/1248ms37980 KiB
16Wrong answer0/1224ms31912 KiB
17Wrong answer0/1190ms23480 KiB
18Wrong answer0/1131ms7464 KiB
19Wrong answer0/1122ms6928 KiB