Problem1081--最长上升子序列Ⅱ

1081: 最长上升子序列Ⅱ

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 722  Solved: 222
[Submit] [Status] [Web Board] [Creator:]

Description

PIPI又来考大家最长上升子序列问题了~
不过这次它想为难一下你~ 
给你一个整数序列,包含n个整数,要你求最长上升子序列的长度~ 

Input

多组输入 
第一行为一个整数n,1<=n<=1000000 
第二行包括n个整数,每个整数均在int范围内 

Output

输出一个整数,表示最长上升子序列的长度。

Sample Input

5
1 2 5 4 7

Sample Output

4

Source/Category