112722024-08-03 12:51:25bzyLegcsalódottabb versenyző (75 pont)cpp14Wrong answer 45/7537ms1300 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 T[n];
	int ans = -1; int maxv = -1;
	for(int i = 0;i<n;i++){
		if(P[i] == mx) T[i] = -1;
		else{
			int c = 0;
			while(c<n){
				if(P[c]<=P[i]) c++;
				else break;
			}
			T[i] = c;
		}
		if(T[i] > maxv){
			maxv = T[i];
			ans = i+1;
		}
	}
	cout<<ans<<endl;
}
SubtaskSumTestVerdictTimeMemory
base45/75
1Accepted0/03ms404 KiB
2Wrong answer0/035ms1188 KiB
3Accepted5/53ms428 KiB
4Accepted5/52ms392 KiB
5Accepted5/53ms356 KiB
6Wrong answer0/53ms504 KiB
7Accepted5/53ms512 KiB
8Accepted5/53ms504 KiB
9Wrong answer0/53ms504 KiB
10Wrong answer0/53ms400 KiB
11Wrong answer0/53ms424 KiB
12Accepted5/54ms384 KiB
13Accepted5/535ms1168 KiB
14Accepted5/537ms1168 KiB
15Wrong answer0/535ms1252 KiB
16Wrong answer0/535ms1300 KiB
17Accepted5/535ms1064 KiB