164272025-04-29 18:03:01algoproKéséscpp17Wrong answer 0/50194ms9648 KiB
// UUID: f47c4b54-1358-4f6d-913c-ebf68a70616c
#include <bits/stdc++.h>
using namespace std;

#define ll long long

int main() 
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

    map<int,int> m;    
    vector <int> v;

    for(int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        v.push_back(x);
        m[x]++;
    }
    
    int r = n-m.size();      //biztos n?
    for (int i = n-1; i >= 0; i--)
    {
        if(m[v[i]]!= 1)
            r--;
        if(r == 0)
        {
            cout << i+1 << '\n';
            break;
        }
    }


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Accepted0/01ms316 KiB
2Wrong answer0/08ms820 KiB
3Wrong answer0/51ms500 KiB
4Wrong answer0/51ms316 KiB
5Wrong answer0/554ms1472 KiB
6Wrong answer0/554ms1556 KiB
7Wrong answer0/4144ms7144 KiB
8Wrong answer0/4143ms6832 KiB
9Wrong answer0/4149ms6188 KiB
10Wrong answer0/4140ms5556 KiB
11Wrong answer0/4126ms5044 KiB
12Wrong answer0/2136ms5040 KiB
13Wrong answer0/2194ms9648 KiB
14Wrong answer0/1194ms9388 KiB
15Wrong answer0/1178ms9224 KiB
16Wrong answer0/1166ms7600 KiB
17Wrong answer0/1134ms5844 KiB
18Wrong answer0/192ms1720 KiB
19Wrong answer0/182ms1716 KiB