231572026-01-16 14:37:09Leventusz09Késéscpp17Wrong answer 0/50211ms9784 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=N-1; i>=0; i--){
        if(!O[i]){
            cout << i + 2 << endl;
            return 0;
        }
    }
    cout << 1 << endl;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms316 KiB
2Wrong answer0/010ms824 KiB
3Wrong answer0/51ms316 KiB
4Wrong answer0/51ms316 KiB
5Wrong answer0/564ms1332 KiB
6Wrong answer0/564ms1416 KiB
7Wrong answer0/4155ms7236 KiB
8Wrong answer0/4152ms6964 KiB
9Wrong answer0/4151ms6188 KiB
10Wrong answer0/4144ms5684 KiB
11Wrong answer0/4136ms4916 KiB
12Wrong answer0/2160ms5428 KiB
13Wrong answer0/2211ms9784 KiB
14Wrong answer0/1211ms9524 KiB
15Wrong answer0/1200ms9268 KiB
16Wrong answer0/1186ms7732 KiB
17Wrong answer0/1165ms5684 KiB
18Wrong answer0/1122ms1664 KiB
19Wrong answer0/1115ms1596 KiB