Problem1080--最长上升子序列Ⅰ

1080: 最长上升子序列Ⅰ

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

Description

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

Input

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

Output

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

Sample Input

5
1 2 5 4 7

Sample Output

4

Source/Category