112382024-07-26 12:37:23bzyLegcsalódottabb versenyző (75 pont)cpp14Wrong answer 45/7537ms1080 KiB
#include <bits/stdc++.h>

using namespace std;
int main()
{
	int n;
	cin>>n;
	vector<int> A;
	int mx = 0;
	for(int i = 0;i<n;i++){
		int a;
		cin>>a;
		A.push_back(a);
		mx = max(mx,a);
	}
	int pos = 0;
	bool notmx = false;
	for(int i = 0; i<n;i++){
		if(A[i] < mx){
			notmx = true;
			if(A[i] > A[pos]) pos =i;
		}
		else break;
	}
	if(notmx == true) cout<<pos+1<<endl;
	else cout<<-1<<endl;
}
SubtaskSumTestVerdictTimeMemory
base45/75
1Accepted0/03ms356 KiB
2Wrong answer0/037ms996 KiB
3Accepted5/53ms356 KiB
4Accepted5/53ms356 KiB
5Accepted5/53ms384 KiB
6Wrong answer0/53ms356 KiB
7Accepted5/52ms376 KiB
8Accepted5/53ms376 KiB
9Wrong answer0/53ms356 KiB
10Wrong answer0/53ms396 KiB
11Wrong answer0/53ms504 KiB
12Accepted5/53ms356 KiB
13Accepted5/537ms956 KiB
14Accepted5/537ms1080 KiB
15Wrong answer0/537ms904 KiB
16Wrong answer0/537ms992 KiB
17Accepted5/537ms920 KiB