摘要: 使用一种二进制的优化, 可以完美的解决这题,《背包九讲》中说的非常好但是还有一种线性复杂的算法。 应该算是该题很巧妙的解法for(i=1;i=0;l--) { if(dp[l]==0) continue; for(k=1;k#include #include #include #include #include #include #include #include using namespace std;#define INF 0x3fffffffstruct node{ int w,c;... 阅读全文
posted @ 2013-07-02 13:46 chenhuan001 阅读(338) 评论(0) 推荐(0) 编辑