- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
#include<iostream>
using namespace std;
int main(){
int n,a[100100],d[100100],ans=d[0]=1,i,j;
cin>>n>>a[0];
for(i = 1;i<n;++i)
for(j =i-1,cin>>a[i],d[i]=1;j>=0;--j)
if(a[i]>a[j]) ans = max(ans, d[i]=max(d[i],d[j]+1));
cout<<ans;
}