#include <bits/stdc++.h> using namespace std; int main(){ int n,t; cin >>n; vector<long long>a; for (int j = 0; j <n ; ++j) {cin >>t;a.push_back(t);} int end,l=0; for(int begin=0;begin<n-1;begin++){ int i=begin+1; end=begin; if(a[i]>a[i-1]){ while (i<n){ if(a[i]>a[i-1]){end=i;i++;} else break; } } int j=i; if((j<n-1)&&(a[j+1]>a[j-1])){j+=2; while (j<n){ if(a[j]>a[j-1]){end=j;j++;} else break; } } if(j==i) end++; l=max(l,end-begin); } cout <<l+1; }
全部评论
(6) 回帖