112792024-08-03 20:30:46bzyLegcsalódottabb versenyző (75 pont)cpp14Accepted 75/7535ms924 KiB
#include <bits/stdc++.h>

using namespace std;
int main()
{
	int n;
	cin>>n;
	vector<int> P(n);
	for(auto& p:P){
		cin>>p;	
	} 
	int ans = -1; int current = 0; int biggest = 0;
	for(int i = 0;i<n;i++){
		if(P[i] > P[current]){
			if(i-current > biggest){
				biggest = i-current;
				ans = current+1; 
			}
			current = i;
		}
	}  
	cout<<ans<<endl;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/02ms356 KiB
2Accepted0/035ms924 KiB
3Accepted5/53ms536 KiB
4Accepted5/53ms356 KiB
5Accepted5/53ms504 KiB
6Accepted5/53ms504 KiB
7Accepted5/53ms356 KiB
8Accepted5/53ms356 KiB
9Accepted5/53ms356 KiB
10Accepted5/53ms504 KiB
11Accepted5/53ms360 KiB
12Accepted5/53ms392 KiB
13Accepted5/535ms760 KiB
14Accepted5/535ms740 KiB
15Accepted5/535ms868 KiB
16Accepted5/535ms668 KiB
17Accepted5/535ms788 KiB