80372024-01-12 11:03:17TundeKéséscpp17Wrong answer 4/50129ms7596 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+1;
    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/03ms1880 KiB
2Wrong answer0/010ms2396 KiB
3Wrong answer0/53ms2292 KiB
4Wrong answer0/53ms2500 KiB
5Wrong answer0/586ms5824 KiB
6Wrong answer0/585ms6044 KiB
7Accepted4/4104ms6224 KiB
8Wrong answer0/4104ms6236 KiB
9Wrong answer0/4104ms6568 KiB
10Wrong answer0/4104ms7056 KiB
11Wrong answer0/4104ms6920 KiB
12Wrong answer0/2129ms6876 KiB
13Wrong answer0/2126ms6964 KiB
14Wrong answer0/1127ms7584 KiB
15Wrong answer0/1128ms7596 KiB
16Wrong answer0/1128ms7488 KiB
17Wrong answer0/1127ms7344 KiB
18Wrong answer0/1129ms7380 KiB
19Wrong answer0/1129ms7540 KiB