78872024-01-11 18:04:32CsongiKéséscpp17Wrong answer 0/50241ms26244 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 j = n - 1;
    while (j >= 0 && talalatok != evek.size())
    {
        if (evek.find(szamok[j]) != evek.end())
        {
            talalatok++;
            if (talalatok == evek.size())
                break;
        }
        j--;
    }
    cout << j;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1812 KiB
2Wrong answer0/013ms3048 KiB
3Wrong answer0/53ms2484 KiB
4Wrong answer0/53ms2560 KiB
5Wrong answer0/564ms6448 KiB
6Wrong answer0/565ms7256 KiB
7Wrong answer0/4179ms20500 KiB
8Wrong answer0/4172ms20060 KiB
9Wrong answer0/4168ms18632 KiB
10Wrong answer0/4157ms17472 KiB
11Wrong answer0/4148ms16228 KiB
12Wrong answer0/2173ms17024 KiB
13Wrong answer0/2237ms26244 KiB
14Wrong answer0/1241ms26020 KiB
15Wrong answer0/1231ms25516 KiB
16Wrong answer0/1224ms22584 KiB
17Wrong answer0/1181ms18380 KiB
18Wrong answer0/1120ms10460 KiB
19Wrong answer0/1115ms9940 KiB