fgbhi @ 2025-01-11 14:32:57
#include<iostream>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;
int a[1005],f[1005];
int main(){
int i,j,k,n,maxx;
cin>>n;
for(i=1;i<=n;i++) cin>>a[i];
f[1]=1;
for(i=2;i<=n;i++)
{
f[i]=0;
for(j=1;j<=i-1;j++)
{
if(a[i]>a[j]) f[i]=max(f[i],f[j]+1);
}
f[i]=max(1,f[i]);
}
for(i=1;i<=n;i++) maxx=max(maxx,f[i]);
cout<<maxx;
}
求调,最后一个点RE