摘要: http://poj.org/problem?id=2184http://blog.csdn.net/liuqiyao_01/article/details/8753686对于负体积问题,可以先定义一个“零点”shift,将dp[shift]设为0,其他都设为-INF。然后负体积从0往maxn+co... 阅读全文
posted @ 2015-12-10 22:17 qlky 阅读(276) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=114&page=show_problem&problem=503以sum/2为背包总量,结果为sum-d*dp[V]#include #inc... 阅读全文
posted @ 2015-12-10 14:11 qlky 阅读(187) 评论(0) 推荐(0) 编辑
摘要: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=565记录路径可以用一个二维数组,记录改变时的量。然后从后往前可以推得所有的值。#include #incl... 阅读全文
posted @ 2015-12-10 10:58 qlky 阅读(223) 评论(0) 推荐(0) 编辑