78882024-01-11 18:05:14CsongiKéséscpp17Wrong answer 0/50252ms23428 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+1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/03ms1832 KiB
2Wrong answer0/013ms3124 KiB
3Wrong answer0/53ms2456 KiB
4Wrong answer0/53ms2396 KiB
5Wrong answer0/564ms5596 KiB
6Wrong answer0/564ms5808 KiB
7Wrong answer0/4175ms17724 KiB
8Wrong answer0/4172ms17460 KiB
9Wrong answer0/4160ms15984 KiB
10Wrong answer0/4152ms14916 KiB
11Wrong answer0/4146ms13380 KiB
12Wrong answer0/2172ms14244 KiB
13Wrong answer0/2252ms23428 KiB
14Wrong answer0/1224ms23124 KiB
15Wrong answer0/1238ms22684 KiB
16Wrong answer0/1209ms19484 KiB
17Wrong answer0/1187ms15456 KiB
18Wrong answer0/1119ms7516 KiB
19Wrong answer0/1115ms7000 KiB