112692024-08-03 11:46:24bzyLegcsalódottabb versenyző (75 pont)cpp14Wrong answer 40/7543ms1220 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(p,mx);
	 }
	int o = 0;
	int T[n] = {0};
	for(int i = 0;i<n;i++){
		for(int j = 0;j<n;j++){
			if(P[i] == mx){
				T[i] = -1;
				break;
			} 
			if(P[j] <= P[i]) T[i]++;
			else{
				break;
			} 
		}
		if(i>0) if(T[i] >T[o]) o = i;
	}
	cout<<o+1<<endl;

}
SubtaskSumTestVerdictTimeMemory
base40/75
1Accepted0/03ms356 KiB
2Wrong answer0/039ms1216 KiB
3Wrong answer0/53ms580 KiB
4Accepted5/53ms396 KiB
5Accepted5/53ms504 KiB
6Wrong answer0/52ms356 KiB
7Accepted5/52ms228 KiB
8Accepted5/53ms376 KiB
9Wrong answer0/53ms512 KiB
10Wrong answer0/53ms424 KiB
11Wrong answer0/53ms256 KiB
12Accepted5/53ms504 KiB
13Accepted5/543ms1136 KiB
14Accepted5/541ms1220 KiB
15Wrong answer0/539ms1056 KiB
16Wrong answer0/539ms1124 KiB
17Accepted5/539ms1072 KiB