摘要: Problem 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 阅读全文
posted @ 2013-05-13 23:01 forevermemory 阅读(123) 评论(0) 推荐(0) 编辑
摘要: P01: 01背包问题 这是最基本的背包问题,每个物品最多只能放一次题目有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。基本思路这是最基础的背包问题,特点是:每种物品仅有一件,可以选择放或不放。用子问题定义状态:即f[i][v]表示前i件物品恰放入一个容量为v的背包可以获得的最大价值。则其状态转移方程便是:f[i][v]=max{f[i-1][v],f[i-1][v-c[i]]+w[i]}。这个方程非常重要,基本上所有跟背包相关的问题的方程都是由它衍生出来的。所以有必要将它详细解释一下:“将 阅读全文
posted @ 2013-05-13 15:59 forevermemory 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … The bone collector had a big bag with a volume of V ,and along his trip of collecting there are a lo 阅读全文
posted @ 2013-05-13 11:56 forevermemory 阅读(151) 评论(0) 推荐(0) 编辑