摘要: 思路: 阅读全文
posted @ 2013-12-08 17:08 SangS 阅读(145) 评论(0) 推荐(0) 编辑
摘要: Q: 既是多重背包, 还是找零问题, 怎么处理?A: 题意理解有误, 店主支付的硬币没有限制, 不占额度, 所以此题不比 1252 难多少DescriptionFarmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest number of coins changes hands, i.e., the number of coins he uses to pay plu 阅读全文
posted @ 2013-12-08 16:52 SangS 阅读(499) 评论(0) 推荐(0) 编辑
摘要: Q: 额外添加了最大高度限制, 需要根据 alt 对数据进行预处理么?A: 是的, 需要根据 alt 对数组排序DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 #include using namespace std;int K;const int MAXN = 40010;bool dp[40010];int h[MAXN], a[MAXN];int V 阅读全文
posted @ 2013-12-08 15:20 SangS 阅读(427) 评论(0) 推荐(0) 编辑
摘要: Q: 倍增优化后, 还是有重复的元素, 怎么办A: 假定重复的元素比较少, 不用考虑DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles had the same value, because then they could just split the co 阅读全文
posted @ 2013-12-08 11:56 SangS 阅读(326) 评论(0) 推荐(0) 编辑
摘要: DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple. Whenever some ACM member has any small money, he takes all the coins and throws them in 阅读全文
posted @ 2013-12-08 11:06 SangS 阅读(297) 评论(0) 推荐(0) 编辑
摘要: Q: 每年一个完全背包?A: YESDescriptionJohn never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that John was the only inheritor.John did not need that much money for the moment. But he re 阅读全文
posted @ 2013-12-08 10:48 SangS 阅读(265) 评论(0) 推荐(0) 编辑
摘要: Q: 01背包最后返回什么 dp[v], v 是多少?A: 普通01背包需要遍历, 从大到小. 但此题因为物品的总重量必定大于背包容量, 所以直接返回 dp[V] 即可update 2014年3月14日11:22:551. 几个月后, 感觉返回的不应该是 dp[V], 二是 dp[0...V] 中的最大值DescriptionDearboy was so busy recently that now he has piles of clothes to wash. Luckily, he has a beautiful and hard-working girlfriend to help h 阅读全文
posted @ 2013-12-08 10:06 SangS 阅读(219) 评论(0) 推荐(0) 编辑