摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2844多重背包问题.求出恰好能买的数目.最后找f[i]>0的背包有几个或者不需要恰好装满,最后搜索f[i] == i 的数目//背包模版 1 #include <iostream> 2 using namespace std; 3 const int MAX = 100000 + 10; 4 const int INF = 0x7fffffff; 5 int f[MAX]; 6 int v; 7 void ZeroOnePack(int cost,int weight) 8 { 9 int 阅读全文
posted @ 2012-09-12 16:32 zx雄 阅读(1010) 评论(0) 推荐(0) 编辑