Problem1039--最长上升子序列Ⅰ

1039: 最长上升子序列Ⅰ

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

PIPI要来考考大家一个经典问题——最长上升子序列。
给你一个整数序列,包含n个整数,要你求最长上升子序列的长度~

Input

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

Output

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

Sample Input Copy

5
1 2 5 4 7

Sample Output Copy

4

Source/Category