摘要: ref: http://www.lintcode.com/en/problem/coins-in-a-line-ii/# 有个博客说的挺好的,比九章自己写的清楚 http://www.cnblogs.com/theskulls/p/4963317.html 意思是这样的: 如果我们在第i个位置,那么 阅读全文
posted @ 2016-11-05 06:36 warmland 阅读(228) 评论(0) 推荐(0) 编辑
摘要: ref: http://www.lintcode.com/en/problem/coins-in-a-line/ There are n coins in a line. Two players take turns to take one or two coins from right side 阅读全文
posted @ 2016-11-05 06:10 warmland 阅读(210) 评论(0) 推荐(0) 编辑
摘要: ref: https://leetcode.com/problems/coin-change/ 就是完全背包问题,可以再复习一遍背包问题。 01背包: for 每一个item for amount...cost[item] f[v] = Max{f[v], f[v-cost[item]] + wei 阅读全文
posted @ 2016-11-05 02:48 warmland 阅读(190) 评论(0) 推荐(0) 编辑