112402024-07-26 12:49:30bzyLegcsalódottabb versenyző (75 pont)cpp14Wrong answer 45/7537ms1140 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(notmx == false){
			if(A[i] != mx){
				pos = i;
				notmx = true;
				if(i > 0) break;
			}
		}
		else{
			if(A[i] == mx) break;
			else if(A[i] > A[pos]) pos = i;
		}
	}
	if(notmx == true) cout<<pos+1<<endl;
	else cout<<-1<<endl;
}
SubtaskSumTestVerdictTimeMemory
base45/75
1Accepted0/03ms280 KiB
2Wrong answer0/037ms1032 KiB
3Accepted5/53ms384 KiB
4Accepted5/53ms528 KiB
5Accepted5/52ms632 KiB
6Wrong answer0/53ms228 KiB
7Accepted5/53ms620 KiB
8Accepted5/53ms504 KiB
9Wrong answer0/53ms504 KiB
10Wrong answer0/53ms356 KiB
11Wrong answer0/53ms488 KiB
12Accepted5/53ms376 KiB
13Accepted5/537ms904 KiB
14Accepted5/537ms992 KiB
15Wrong answer0/537ms1140 KiB
16Wrong answer0/537ms936 KiB
17Accepted5/537ms1140 KiB