标签:blog http for sp div c on log amp
http://acm.fzu.edu.cn/problem.php?pid=1348
const int maxn = 1008 ; int a[maxn] , c[maxn] ; int main(){ int i , n , m ; while(cin>>n){ for(i = 1 ; i <= n ; i++) scanf("%d" , &a[i]) ; m = 0 ; c[m++] = a[1] ; for(i = 2 ; i <= n ; i++){ if(a[i] > c[m-1]) c[m++] = a[i] ; else c[lower_bound(c , c+m , a[i]) - c] = a[i] ; } cout<< m << endl ; } return 0 ; }
标签:blog http for sp div c on log amp
原文地址:http://www.cnblogs.com/liyangtianmen/p/4003181.html