112372024-07-26 12:30:44bzyLegcsalódottabb versenyző (75 pont)cpp14Wrong answer 35/7537ms1260 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;
		}
	}
	if(notmx == true) cout<<pos+1<<endl;
	else cout<<-1<<endl;
}
SubtaskSumTestVerdictTimeMemory
base35/75
1Accepted0/03ms384 KiB
2Wrong answer0/037ms1036 KiB
3Accepted5/53ms492 KiB
4Accepted5/53ms372 KiB
5Accepted5/53ms384 KiB
6Wrong answer0/53ms384 KiB
7Accepted5/53ms500 KiB
8Accepted5/53ms356 KiB
9Wrong answer0/53ms488 KiB
10Wrong answer0/53ms384 KiB
11Wrong answer0/53ms376 KiB
12Wrong answer0/53ms228 KiB
13Accepted5/537ms1068 KiB
14Accepted5/537ms1140 KiB
15Wrong answer0/537ms964 KiB
16Wrong answer0/537ms992 KiB
17Wrong answer0/537ms1260 KiB