随笔分类 -  动态规划------

摘要:给出长度为N的数组,找出这个数组的最长递增子序列。(递增子序列是指,子序列的元素是递增的) 例如:5 1 6 8 2 4 5 10,最长递增子序列是1 2 4 5 10。 Input Output Input示例 Output示例 不过由于N最大是50000,用上面的方法肯定会超时的,这是可以用到l 阅读全文
posted @ 2017-07-18 16:16 starry_sky 阅读(186) 评论(0) 推荐(0)
摘要:1257 背包问题 V3 N个物品的体积为W1,W2......Wn(Wi为整数),与之相对应的价值为P1,P2......Pn(Pi为整数),从中选出K件物品(K <= N),使得单位体积的价值最大。 N个物品的体积为W1,W2......Wn(Wi为整数),与之相对应的价值为P1,P2..... 阅读全文
posted @ 2017-07-18 12:34 starry_sky 阅读(181) 评论(0) 推荐(0)
摘要:H. Special Palindrome A sequence of positive and non-zero integers called palindromic if it can be read the same forward and backward, for example: 15 阅读全文
posted @ 2017-07-17 20:12 starry_sky 阅读(353) 评论(0) 推荐(0)
摘要:51Nod 1006 a[i][j] 为a1,a2...ai与b1,b2....bj最长的公共子序列。 阅读全文
posted @ 2017-07-15 10:16 starry_sky 阅读(155) 评论(0) 推荐(0)