67692023-12-19 08:22:40madvirKéséscpp17Accepted 50/50254ms22276 KiB
#include <iostream>
#include <set>

using namespace std;

int main()
{
    unsigned int n, minp=0;
    cin >> n;
    int a[n];
    set<int> evek;

    for(unsigned int i=0; i<n; i++) {
        cin >> a[i];
        evek.insert(a[i]);
    }
    minp=evek.size();
    evek.clear();
    int z=n;
    while(evek.size()<minp && z>=0) {
        z--;
        evek.insert(a[z]);
    }
    cout << ++z;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1812 KiB
2Accepted0/014ms3044 KiB
3Accepted5/53ms2360 KiB
4Accepted5/53ms2504 KiB
5Accepted5/565ms4404 KiB
6Accepted5/564ms4424 KiB
7Accepted4/4208ms16332 KiB
8Accepted4/4236ms16120 KiB
9Accepted4/4179ms14536 KiB
10Accepted4/4175ms13684 KiB
11Accepted4/4156ms12340 KiB
12Accepted2/2215ms13432 KiB
13Accepted2/2252ms22252 KiB
14Accepted1/1254ms22276 KiB
15Accepted1/1240ms21936 KiB
16Accepted1/1214ms18840 KiB
17Accepted1/1184ms14520 KiB
18Accepted1/1128ms6560 KiB
19Accepted1/1119ms6420 KiB