121042024-12-02 15:16:22szasztundeKéséscpp17Accepted 50/50216ms8760 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/01ms320 KiB
2Accepted0/010ms568 KiB
3Accepted5/51ms320 KiB
4Accepted5/52ms320 KiB
5Accepted5/564ms444 KiB
6Accepted5/564ms440 KiB
7Accepted4/4153ms6348 KiB
8Accepted4/4155ms6132 KiB
9Accepted4/4149ms5176 KiB
10Accepted4/4142ms4644 KiB
11Accepted4/4136ms3896 KiB
12Accepted2/2163ms4260 KiB
13Accepted2/2216ms8760 KiB
14Accepted1/1196ms8504 KiB
15Accepted1/1194ms8392 KiB
16Accepted1/1195ms6712 KiB
17Accepted1/1172ms4660 KiB
18Accepted1/1122ms860 KiB
19Accepted1/1115ms568 KiB