a_study_xxs @ 2023-05-10 19:24:29
#include<iostream>
using namespace std;
int n , a[1005] , ans;
int main(){
cin >> n ;
for(int i = 1; i <= n ; i ++ ){
cin >> a[i] ;
}
int k = 1;
for(int i = 2 ; i <= n ; i ++ ){
if(a[i] > a[i - 1]){
k ++ ;
}else{
ans = max(ans , k) ;
k = 1 ;
}
}
cout << ans ;
return 0;
}
by AzureHair @ 2023-05-10 19:30:46
你这个求的是连续最长上升子序列吧,样例是
by cressbaby @ 2023-05-20 09:41:57
最长上升子序列是可以不连续的
by HenryQ2022 @ 2023-06-20 19:11:04
这道题要用线性DP