134932025-01-08 08:44:39antiKéséscpp17Wrong answer 9/50125ms1904 KiB
#include <iostream>
#include <algorithm>

using namespace std;

struct tomb{
    int ertek, sorszam;
};

bool comp(tomb a,tomb b){
    return a.ertek < b.ertek;
}

int main()
{
    int n;
    cin >> n;
    tomb t[n+1];
    for(int i=0; i<n; i++){
        cin >> t[i].ertek;
        t[i].sorszam = i+1;
    }
    sort(t, t+n, comp);
    t[n+1].ertek = -1;

    int meg = n;
    for(int i=n-1; i>=0; i--){
        if(t[i].ertek != t[i+1].ertek){
            if(t[i].sorszam < meg){
                meg = t[i].sorszam;
            }
        }
    }
    cout << meg;
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Accepted0/01ms316 KiB
2Wrong answer0/08ms316 KiB
3Accepted5/51ms316 KiB
4Wrong answer0/51ms316 KiB
5Wrong answer0/570ms1728 KiB
6Wrong answer0/570ms1856 KiB
7Accepted4/498ms1812 KiB
8Wrong answer0/498ms1844 KiB
9Wrong answer0/498ms1848 KiB
10Wrong answer0/498ms1844 KiB
11Wrong answer0/497ms1772 KiB
12Wrong answer0/2123ms1768 KiB
13Wrong answer0/2125ms1852 KiB
14Wrong answer0/1123ms1768 KiB
15Wrong answer0/1123ms1844 KiB
16Wrong answer0/1123ms1844 KiB
17Wrong answer0/1123ms1904 KiB
18Wrong answer0/1119ms1844 KiB
19Wrong answer0/1119ms1736 KiB