题目:http://acm.hdu.edu.cn/diy/contest_show.php?cid=20083密码:shuacm感觉他们学校的新生训练出的比较好。今天很多题目都是强化了背包的转化。关于背包转化成求最优解见分析:点击打开链接贴个背包的模板://0-1背包, 代价为 cost, 获得的价值为 weight // 每种物品最多只可以选一次 void ZeroOnePack(int cost, int weight) { for(int i = nValue; i >= cost; i--) dp[i] = dp[i] + dp[i-cost]+weight; ... Read More
posted @ 2013-07-19 20:00 free斩 Views(234) Comments(0) Diggs(0) Edit