78952024-01-11 18:31:02CsongiKéséscpp17Accepted 50/50243ms46260 KiB
#include <iostream>
#include <bits/stdc++.h>
#include <unordered_set>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<long long int> szamok(n);
    unordered_set<long long int> evek;
    for (int i = 0; i < n; i++)
    {
        long long int most;
        cin >> most;
        szamok[i] = most;
        evek.insert(most);
    }
    map<long long int, bool> talalt;
    int talalatok = 0;
    int szam = 0;
    for (int i = n - 1; i >= 0; i--)
    {
       talalt[szamok[i]] = true;
       szam = i;
       if (talalt.size() == evek.size())
        break;
    }
    cout << szam+1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1812 KiB
2Accepted0/014ms4108 KiB
3Accepted5/53ms2288 KiB
4Accepted5/53ms2500 KiB
5Accepted5/554ms5564 KiB
6Accepted5/556ms6036 KiB
7Accepted4/4189ms32304 KiB
8Accepted4/4187ms31868 KiB
9Accepted4/4167ms28960 KiB
10Accepted4/4149ms26572 KiB
11Accepted4/4134ms22612 KiB
12Accepted2/2190ms25484 KiB
13Accepted2/2243ms46260 KiB
14Accepted1/1238ms45692 KiB
15Accepted1/1234ms45384 KiB
16Accepted1/1228ms36128 KiB
17Accepted1/1182ms27812 KiB
18Accepted1/1119ms9316 KiB
19Accepted1/1109ms8316 KiB