78892024-01-11 18:10:48CsongiKéséscpp17Wrong answer 0/50244ms23624 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++;
        }
        j--;
    }
    cout << talalatok - 1;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/03ms1812 KiB
2Wrong answer0/013ms3096 KiB
3Wrong answer0/53ms2380 KiB
4Wrong answer0/53ms2584 KiB
5Wrong answer0/565ms5800 KiB
6Wrong answer0/567ms6088 KiB
7Wrong answer0/4179ms18080 KiB
8Wrong answer0/4175ms17820 KiB
9Wrong answer0/4163ms16340 KiB
10Wrong answer0/4157ms15388 KiB
11Wrong answer0/4149ms14052 KiB
12Wrong answer0/2178ms14788 KiB
13Wrong answer0/2244ms23624 KiB
14Wrong answer0/1237ms23528 KiB
15Wrong answer0/1224ms23352 KiB
16Wrong answer0/1207ms20356 KiB
17Wrong answer0/1182ms16156 KiB
18Wrong answer0/1128ms8192 KiB
19Wrong answer0/1119ms7800 KiB