112712024-08-03 12:36:55bzyLegcsalódottabb versenyző (75 pont)cpp14Wrong answer 45/7535ms1012 KiB
#include <bits/stdc++.h>

using namespace std;
int main()
{
	int n;
	cin>>n;
	vector<int> P(n);
	int mx = 0;
	for(auto& p : P){
	 	cin>>p;
	 	mx = max(mx,p);
	}
	int l=0; int r=1; int ans = -1; int current = 0;
	if(P[0]==mx){
	for(int i = 0;i<n;i++) if(P[i] != mx) ans = i+1;
	}
	else{
		while(r<n){
			if(P[r]>P[l]){
				current += r-l;
				ans = l+1;
				l=r;
			}
			r++;
		}
	}
	cout<<ans<<endl;
}
SubtaskSumTestVerdictTimeMemory
base45/75
1Accepted0/03ms384 KiB
2Wrong answer0/034ms740 KiB
3Accepted5/53ms356 KiB
4Accepted5/53ms500 KiB
5Accepted5/53ms384 KiB
6Wrong answer0/53ms504 KiB
7Accepted5/53ms356 KiB
8Accepted5/52ms356 KiB
9Wrong answer0/53ms356 KiB
10Wrong answer0/53ms400 KiB
11Wrong answer0/53ms452 KiB
12Accepted5/53ms380 KiB
13Accepted5/535ms820 KiB
14Accepted5/534ms888 KiB
15Wrong answer0/534ms1012 KiB
16Wrong answer0/534ms820 KiB
17Accepted5/534ms740 KiB