69612023-12-21 23:51:49999Völgy (100 pont)cpp17Wrong answer 80/10039ms9636 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;cin>>n;
	vector<int> v(n+1);
	for(int i = 1;i<=n;i++)
		cin>>v[i];
	int i=1,ans=-1;
	while(i<=n-2){
		int j=i+1;
		while(j<=n&&v[j]<v[i]){
			j++;
		}
		if(j-i>=2&&j!=n+1){
			ans=max(ans,j-i);
		}
		i=j;
	}
	cout<<ans<<endl;
}
SubtaskSumTestVerdictTimeMemory
base80/100
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2060 KiB
3Accepted5/53ms2272 KiB
4Accepted5/53ms2392 KiB
5Wrong answer0/53ms2528 KiB
6Wrong answer0/53ms2612 KiB
7Accepted5/53ms2756 KiB
8Accepted5/53ms2808 KiB
9Accepted5/53ms2940 KiB
10Wrong answer0/53ms3160 KiB
11Accepted5/54ms3492 KiB
12Accepted5/54ms3788 KiB
13Accepted5/54ms3892 KiB
14Wrong answer0/56ms4176 KiB
15Accepted5/532ms5296 KiB
16Accepted5/535ms5788 KiB
17Accepted5/535ms6368 KiB
18Accepted5/535ms6956 KiB
19Accepted5/535ms7532 KiB
20Accepted5/539ms8252 KiB
21Accepted5/539ms8948 KiB
22Accepted5/539ms9636 KiB