| 记录编号 | 490205 | 评测结果 | AAAAAAAAAA | 
    
        | 题目名称 | 1398.最长上升子序列 | 最终得分 | 100 | 
    
        | 用户昵称 |  CSU_Turkey | 是否通过 | 通过 | 
    
        | 代码语言 | C++ | 运行时间 | 0.031 s | 
    
        | 提交时间 | 2018-03-08 10:22:33 | 内存使用 | 0.19 MiB | 
    
    
    
    		显示代码纯文本
		
		#include<bits/stdc++.h>
using namespace std;
const int inf=1005;
int n,ans;
int h[inf],top;
int main()
{
	freopen("lis1.in","r",stdin);
	freopen("lis1.out","w",stdout);
	scanf("%d",&n);
	h[0]=-0x3fffffff;
	for(int i=1;i<=n;i++){
		int x;
		scanf("%d",&x);
		if(x>h[top])h[++top]=x;
		else {
			int l=1,r=top;
			while(l!=r){
				int mid=(l+r)>>1;
				if(h[mid]<x)l=mid+1;
				else r=mid;
			}
			h[l]=x;
		}
	}
	printf("%d\n",top);
	return 0;
}