231592026-01-16 14:39:48Leventusz09Késéscpp17Wrong answer 0/50209ms9620 KiB
#include <iostream>
#include <set>

using namespace std;

int main(){
    int N;
    cin >> N;
    int E[N];
    bool O[N];
    for(int i=0; i<N; O[i++] = 0) cin >> E[i];

    set<int> S;

    for(int i=N-1; i>=0; i--){
        if(S.find(E[i]) == S.end()){
            // nem van benne
            S.insert(E[i]);
            O[i] = 1;
        }
    }

    //for(int i=0; i<N; i++) cout << O[i] << " ";
    //cout << endl;

    for(int i=0; i<N; i++){
        if(O[i]){
            cout << i << endl;
            return 0;
        }
    }
    cout << 1 << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/010ms820 KiB
3Wrong answer0/51ms316 KiB
4Wrong answer0/51ms316 KiB
5Wrong answer0/568ms1220 KiB
6Wrong answer0/567ms1412 KiB
7Wrong answer0/4158ms7076 KiB
8Wrong answer0/4163ms7076 KiB
9Wrong answer0/4148ms6196 KiB
10Wrong answer0/4143ms5684 KiB
11Wrong answer0/4138ms4916 KiB
12Wrong answer0/2166ms5412 KiB
13Wrong answer0/2207ms9620 KiB
14Wrong answer0/1203ms9524 KiB
15Wrong answer0/1209ms9268 KiB
16Wrong answer0/1197ms7732 KiB
17Wrong answer0/1168ms5684 KiB
18Wrong answer0/1128ms1612 KiB
19Wrong answer0/1120ms1536 KiB