摘要: 题目大意是用 1,5,10,25,50 五种钱组成一个给定的N ,求有多少种组发。。dp[i]为 价值I 的个数, 那么dp[i] += dp[i-k] (k为上面五种钱币 。。 )题目:Coin ChangeSuppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money. For example, if we have 11 cents, then we 阅读全文
posted @ 2013-12-28 19:32 doubleshik 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 标题就说明了方法 。。 典型的dp题目:Problem C: Longest Common SubsequenceSequence 1: Sequence 2: Given two sequences of characters, print thelength of the longest common subsequence of both sequences. Forexample, the longest common subsequence of the following twosequences:abcdghaedfhris adh of leng... 阅读全文
posted @ 2013-12-28 11:09 doubleshik 阅读(244) 评论(0) 推荐(0) 编辑