78932024-01-11 18:17:39CsongiKéséscpp17Wrong answer 0/50231ms23112 KiB
#include <iostream>
#include <bits/stdc++.h>
#include <set>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<long long int> szamok(n);
    set<long long int> evek;
    for (int i = 0; i < n; i++)
    {
        long long int most;
        cin >> most;
        szamok[i] = most;
        evek.insert(most);
    }
    int talalatok = 0;
    int szam = 0;
    for (int i = n - 1; i >= 0; i--)
    {
        if (evek.find(szamok[i]) != evek.end())
        {
            talalatok++;
            if (evek.size() == talalatok)
                break;
        }
        szam = i;
    }
    cout << szam;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/03ms1808 KiB
2Wrong answer0/013ms3104 KiB
3Wrong answer0/53ms2380 KiB
4Wrong answer0/53ms2424 KiB
5Wrong answer0/564ms5520 KiB
6Wrong answer0/564ms5700 KiB
7Wrong answer0/4178ms17788 KiB
8Wrong answer0/4170ms17520 KiB
9Wrong answer0/4168ms16036 KiB
10Wrong answer0/4156ms14844 KiB
11Wrong answer0/4148ms13540 KiB
12Wrong answer0/2174ms14288 KiB
13Wrong answer0/2231ms23112 KiB
14Wrong answer0/1231ms22984 KiB
15Wrong answer0/1226ms22656 KiB
16Wrong answer0/1222ms19472 KiB
17Wrong answer0/1193ms15312 KiB
18Wrong answer0/1125ms7380 KiB
19Wrong answer0/1115ms7000 KiB