10312022-02-25 18:39:41Kevinke12Késéscpp14Accepted 50/50351ms53112 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int N;
ll be1;
vector<ll> t;
set<ll> ossz;
set<ll> akt;

int main()
{
    cin >> N;
    for(int i = 0; i < N;i++)
    {
        cin >> be1;
        ossz.insert(be1);
        t.push_back(be1);
    }
    for(int i = N-1; i >= 0;i--)
    {
        akt.insert(t[i]);
        //cout << akt.size() << "\n";
        if(akt.size() == ossz.size())
        {
            cout << i+1 << "\n";
            break;
        }
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1804 KiB
2Accepted0/014ms3708 KiB
3Accepted5/51ms2068 KiB
4Accepted5/52ms2064 KiB
5Accepted5/564ms6900 KiB
6Accepted5/561ms7676 KiB
7Accepted4/4293ms31388 KiB
8Accepted4/4275ms32052 KiB
9Accepted4/4243ms30240 KiB
10Accepted4/4209ms28968 KiB
11Accepted4/4196ms27740 KiB
12Accepted2/2256ms30908 KiB
13Accepted2/2351ms50700 KiB
14Accepted1/1319ms51852 KiB
15Accepted1/1342ms53112 KiB
16Accepted1/1289ms48612 KiB
17Accepted1/1222ms42280 KiB
18Accepted1/1137ms28332 KiB
19Accepted1/1123ms29560 KiB