80652024-01-12 11:47:29TundeKéséscpp17Accepted 50/50131ms6940 KiB
#include <iostream>
#include <algorithm>

using namespace std;

struct evszam
{
    int e, s;
};

int novekvo(evszam a, evszam b)
{
    if(a.e==b.e)
    {
        return a.s>b.s;
    }
    else
        return a.e<b.e;
}

int main()
{
    int n;
    cin >> n;
    evszam t[n];
    for(int i=0; i<n; i++)
    {
        cin >> t[i].e;
        t[i].s=i+1;
    }
    sort(t, t+n, novekvo);
    int k=t[0].s;
    for(int i=1; i<n; i++)
    {
        if(t[i].e!=t[i-1].e && t[i].s<k)
            k=t[i].s;
    }
    cout << k;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1880 KiB
2Accepted0/010ms2396 KiB
3Accepted5/53ms2480 KiB
4Accepted5/53ms2464 KiB
5Accepted5/582ms5704 KiB
6Accepted5/582ms5940 KiB
7Accepted4/4100ms6412 KiB
8Accepted4/4100ms6448 KiB
9Accepted4/4100ms6528 KiB
10Accepted4/4101ms6548 KiB
11Accepted4/4101ms6712 KiB
12Accepted2/2131ms6868 KiB
13Accepted2/2123ms6852 KiB
14Accepted1/1120ms6808 KiB
15Accepted1/1120ms6896 KiB
16Accepted1/1122ms6904 KiB
17Accepted1/1120ms6940 KiB
18Accepted1/1125ms6888 KiB
19Accepted1/1125ms6788 KiB