RYIP在线题库
首 页   >   习题练习   >   提交
Problem1531--最长不下降子序列

1531: 最长不下降子序列

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

【 Description 】

设有整数序列b1,b2,b3,…,bm,若存在 i1 < i2 < i3 < … < in,且 bi1 <= bi2 <=bi3 <=…<=bin,则称b1,b2,b3,…,bm中有长度为n的不下降序列bi1,bi2,bi3,…,bin。求序列中最大不下降子序列长度k。

【 Input 】

输入文件为两行,第一行输入m(1<=m<=10000),表示有m个整数,接下来的第二行输入m个整数

【 Output 】

输出文件为一行,即最大不下降子序列的长度


【 Sample Input 】

7
25 14 33 108 10 44 87

【 Sample Output 】

4

【 Source/Category 】