69912023-12-24 14:33:45MagyarKendeSZLGKéséscpp17Accepted 50/50168ms38868 KiB
#include <iostream>
#include <vector>
#include <set>
using namespace std;
#define speed cin.tie(0); ios::sync_with_stdio(0)

int main() {
    speed;
    int N;
    cin >> N;
    vector<int> v(N);
    set<int> s, t;
    for (int i = 0; i < N; i++) {
        cin >> v[i];
        s.insert(v[i]);
    }
    for (int i = N - 1; i >= 0; i--) {
        t.insert(v[i]);
        if (t.size() == s.size()) {
            cout << i + 1;
            exit(0);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1824 KiB
2Accepted0/010ms3808 KiB
3Accepted5/53ms2428 KiB
4Accepted5/53ms2372 KiB
5Accepted5/535ms4220 KiB
6Accepted5/535ms4428 KiB
7Accepted4/4153ms28320 KiB
8Accepted4/4144ms27716 KiB
9Accepted4/4128ms24612 KiB
10Accepted4/4115ms22156 KiB
11Accepted4/4105ms19552 KiB
12Accepted2/2129ms21188 KiB
13Accepted2/2168ms38868 KiB
14Accepted1/1165ms38284 KiB
15Accepted1/1167ms37392 KiB
16Accepted1/1143ms31004 KiB
17Accepted1/1120ms22808 KiB
18Accepted1/168ms6700 KiB
19Accepted1/157ms5840 KiB