
简单DP
文章平均质量分 60
ukiy
这个作者很懒,什么都没留下…
展开
-
最长递增子序列详解(longest increasing subsequence)(转)
一个各公司都喜欢拿来做面试笔试题的经典动态规划问题,互联网上也有很多文章对该问题进行讨论,但是我觉得对该问题的最关键的地方,这些讨论似乎都解释的不很清楚,让人心中不快,所以自己想彻底的搞一搞这个问题,希望能够将这个问题的细节之处都能够说清楚。 对于动态规划问题,往往存在递推解决方法,这个问题也不例外。要求长度为i的序列的Ai{a1,a2,……,ai}最长递增子序列,需要先求出序列Ai-1{a1,a2转载 2016-09-08 10:16:29 · 522 阅读 · 0 评论 -
hdu1003 Max Sum(dp)
Problem Description Given a sequence a[1],a[2],a[3]……a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 =原创 2017-01-23 22:41:29 · 344 阅读 · 0 评论 -
hdu 1599 Common Subsequence(DP)
Problem Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, …, xm> another sequence Z = < z1, z2, …, zk> is原创 2017-01-28 20:27:11 · 288 阅读 · 0 评论