80312024-01-12 10:57:54TundeKéséscpp17Wrong answer 4/50129ms6832 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);
    for(int i=1; i<n; i++)
    {
        if(t[i].e==t[i-1].e)
        {
            t[i].e=0;
        }
    }
    int k=n;
    for(int i=0; i<n; i++)
    {
        if(t[i].e!=0 && t[i].s<k)
            k=t[i].s;
    }
    cout << k;
}
SubtaskSumTestVerdictTimeMemory
base4/50
1Accepted0/03ms1876 KiB
2Wrong answer0/010ms2352 KiB
3Wrong answer0/53ms2284 KiB
4Wrong answer0/53ms2492 KiB
5Wrong answer0/585ms5828 KiB
6Wrong answer0/585ms6200 KiB
7Accepted4/4104ms5968 KiB
8Wrong answer0/4104ms6056 KiB
9Wrong answer0/4104ms6092 KiB
10Wrong answer0/4104ms6324 KiB
11Wrong answer0/4104ms6436 KiB
12Wrong answer0/2128ms6252 KiB
13Wrong answer0/2128ms6376 KiB
14Wrong answer0/1127ms6588 KiB
15Wrong answer0/1127ms6596 KiB
16Wrong answer0/1128ms6588 KiB
17Wrong answer0/1127ms6832 KiB
18Wrong answer0/1129ms6604 KiB
19Wrong answer0/1129ms6600 KiB