79362024-01-12 07:48:36TundeKéséscpp17Runtime error 40/50148ms130284 KiB
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    int t[n];
    int lk=5000, lki=0, ln=0, lni=0;
    for(int i=0; i<n; i++)
    {
        cin >> t[i];
        if(t[i]>ln)
        {
            ln=t[i];
            lni=i;
        }
        if(t[i]<lk)
        {
            lk=t[i];
            lki=i;
        }
    }
    int r[ln-lk];
    for(int i=0; i<n; i++)
    {
        r[t[i]-lk]=i;
    }
    int x=0;
    for(int i=0; i<n && x==0; i++)
    {
        if(r[t[i]-lk]==i)
        {
            ++x;
            cout << i+1;
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base40/50
1Accepted0/03ms2152 KiB
2Accepted0/08ms2528 KiB
3Accepted5/53ms2544 KiB
4Accepted5/53ms2660 KiB
5Accepted5/550ms4420 KiB
6Accepted5/550ms4556 KiB
7Accepted4/471ms6228 KiB
8Accepted4/471ms6444 KiB
9Accepted4/471ms6520 KiB
10Accepted4/471ms6652 KiB
11Accepted4/475ms6648 KiB
12Runtime error0/2136ms130284 KiB
13Runtime error0/2140ms130212 KiB
14Runtime error0/1148ms130072 KiB
15Runtime error0/1136ms130060 KiB
16Runtime error0/1148ms129852 KiB
17Runtime error0/1136ms129616 KiB
18Runtime error0/1136ms129584 KiB
19Runtime error0/1136ms129592 KiB