231552026-01-16 14:35:48Leventusz09Késéscpp17Wrong answer 0/50214ms9780 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;
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms512 KiB
2Wrong answer0/010ms820 KiB
3Wrong answer0/51ms316 KiB
4Wrong answer0/51ms316 KiB
5Wrong answer0/564ms1188 KiB
6Wrong answer0/564ms1412 KiB
7Wrong answer0/4151ms7224 KiB
8Wrong answer0/4152ms6888 KiB
9Wrong answer0/4149ms6196 KiB
10Wrong answer0/4143ms5684 KiB
11Wrong answer0/4138ms4920 KiB
12Wrong answer0/2162ms5276 KiB
13Wrong answer0/2209ms9780 KiB
14Wrong answer0/1196ms9688 KiB
15Wrong answer0/1214ms9268 KiB
16Wrong answer0/1194ms7732 KiB
17Wrong answer0/1167ms5592 KiB
18Wrong answer0/1120ms1844 KiB
19Wrong answer0/1115ms1572 KiB