最长上升子序列
2018-02-14 21:00
120 查看
最长上升子序列
Time Limit: 3000 ms Memory Limit: 65536 KiB[align=center]Submit Statistic[/align]Problem Description
一个数的序列bi,当b1 < b2 < ... < bS的时候,我们称这个序列是上升的。对于给定的一个序列(a1, a2, ..., aN),我们可以得到一些上升的子序列(ai1, ai2, ..., aiK),这里1<= i1 < i2< ... < iK <= N。比如,对于序列(1, 7, 3, 5, 9, 4, 8),有它的一些上升子序列,如(1, 7), (3, 4, 8)等等。这些子序列中最长的长度是4,比如子序列(1, 3, 5, 8)。你的任务,就是对于给定的序列,求出最长上升子序列的长度。
Input
输入的第一行是序列的长度N (1 <= N <= 1000)。第二行给出序列中的N个整数,这些整数的取值范围都在0到10000。Output
最长上升子序列的长度。Sample Input
7 1 7 3 5 9 4 8
Sample Output
4
Hint
Source
Northeastern Europe 2002相关文章推荐
- HDU-1159 Common Subsequence 最长上升子序列
- sdutacm-最长上升子序列
- UVa 10534 - Wavio Sequence (最长上升子序列LIS)
- hdu 3308 线段树-区间连续最长上升子序列
- 最长上升子序列nlogn算法
- POJ 1631 Bridging signals 最长上升子序列
- 最长上升子序列
- hdu1160 FatMouse's Speed 最长上升子序列以及记录路径 DP
- hdu1257 另附:http://acm.nyist.net/JudgeOnline/problem.php?pid=214(最长上升子序列)
- DP之最长上升子序列O(n*logn)算法
- nyoj 16 最长上升子序列变形
- 动态规划--最长上升子序列
- LIS算法(最长上升子序列)
- hdu 1423 Greatest Common Increasing Subsequence 最长公共上升子序列
- HDU - 1025 Constructing Roads In JGShining's Kingdom (nlogn 最长上升子序列)
- hdu 3998 Sequence --最长上升子序列+最大流
- hdoj1950Bridging signals(最长上升子序列)
- 最长上升子序列
- 动态规划-最长上升子序列(LIS)
- 算法题:最长上升子序列