C++55分求助
查看原帖
C++55分求助
1020763
Dead_Butterfly楼主2023/10/3 14:00

#4,#6,#7,#8,#9:TLE

Code:

#include<bits/stdc++.h>
#define For(i,x,y) for(int i=x;i<=y;i++)
#define Dor(i,x,y) for(int i=x;i>=y;i--)
using namespace std;
int n,a[1000005],s,ma;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	For(i,1,n) cin>>a[i];
	For(i,1,n)
	{
		s=0;
		For(j,i,n)
		{
			if(a[j]<=a[j-1]&&j!=i) break;
			s++;
		}
		ma=max(ma,s);
	}
	cout<<ma;
	return 0;
}
2023/10/3 14:00
加载中...