69282023-12-20 09:39:43szabelrKéséscpp17Accepted 50/50195ms20472 KiB
#include <bits/stdc++.h>

using namespace std;
map<int,int> evsz;
int main()
{
    int n,x;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        evsz[x]=i;
    }

    int mini=n;
    map<int,int>::iterator it;
    for(it=evsz.begin();it!=evsz.end();it++)
    {
        if(it->second<mini)
        {
            mini=it->second;
        }
    }/*
    for(auto it : evsz)
    {
        if(it.second<mini) mini=it.second;
    }*/
    cout<<mini;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1744 KiB
2Accepted0/013ms2700 KiB
3Accepted5/53ms2160 KiB
4Accepted5/53ms2368 KiB
5Accepted5/568ms2716 KiB
6Accepted5/568ms2964 KiB
7Accepted4/4152ms14916 KiB
8Accepted4/4150ms14784 KiB
9Accepted4/4144ms13168 KiB
10Accepted4/4141ms11980 KiB
11Accepted4/4137ms10924 KiB
12Accepted2/2162ms11572 KiB
13Accepted2/2190ms20472 KiB
14Accepted1/1195ms20320 KiB
15Accepted1/1188ms19980 KiB
16Accepted1/1194ms16884 KiB
17Accepted1/1172ms12728 KiB
18Accepted1/1126ms4900 KiB
19Accepted1/1120ms4416 KiB