112392024-07-26 12:47:55bzyLegcsalódottabb versenyző (75 pont)cpp14Wrong answer 45/7537ms1332 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/03ms512 KiB
2Wrong answer0/037ms1332 KiB
3Accepted5/53ms424 KiB
4Accepted5/53ms396 KiB
5Accepted5/53ms356 KiB
6Wrong answer0/53ms512 KiB
7Accepted5/53ms360 KiB
8Accepted5/53ms356 KiB
9Wrong answer0/52ms384 KiB
10Wrong answer0/53ms356 KiB
11Wrong answer0/53ms504 KiB
12Accepted5/53ms356 KiB
13Accepted5/537ms924 KiB
14Accepted5/537ms940 KiB
15Wrong answer0/537ms920 KiB
16Wrong answer0/537ms1124 KiB
17Accepted5/537ms992 KiB