HELPME! 54%AC
查看原帖
HELPME! 54%AC
1127401
JeremyXie楼主2023/11/25 15:04

P1567 统计天数 求助!!! TLE+WA,54%AC

#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
  int d,ans=0;
  cin>>d;
  int t[d+1];
  t[d]=0;
  for(int i=0;i<d;i++) cin>>t[i];
  for(int i=0;i<d;i++){
  	for(int j=i;j<d;j++){
  		if(t[j]<=t[j-1]){
  			if(j-i+1>ans) ans=j-i+1;
  			break;
			}
		}
	}
	cout<<ans;
  return 0;
}

大佬们帮帮我

2023/11/25 15:04
加载中...