最大上升子序列解法:
1.动规转移方程
2.(nlogn)
#include<cstdio>
#include<algorithm>
using namespace std;
const int INF=<<;
int a[];
int f[];
int main() {
int n;
while(~scanf("%d",&n)) {
for(int i=;i<n;i++) scanf("%d",&a[i]);
for(int i=;i<n;i++) f[i]=INF;
for(int i=;i<n;i++) {
int t=lower_bound(f,f+n,a[i])-f;
f[t]=a[i];
}
printf("%d\n",lower_bound(f,f+n,INF)-f);
}
return ;
}