//最大上升子序列
#include <iostream>
#include <cstdio>
#include <algorithm>
#define ll long long
using namespace std;
int N;
int a[1005];
int b[1005] = {1};
int main()
{
cin >> N;
for(int i = 0; i < N; ++i)
cin >> a[i];
for(int i = 1; i < N; ++i)
{
for(int j = 0; j < i; ++j)
{
if(a[j] < a[i])
{
b[i] = max(b[j]+1, b[i]);
}
}
}
int MaxIncrease = *max_element(b, b+N);
cout << MaxIncrease;
return 0;
}
网友评论