摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2191题意: 给出大米的价格、重量和袋数,要你计算出在规定的钱数内买最多(重)的米。坑爹: 算是多重背包问题的模版题吧。解法: 多重背包。View Code 1 #include<iostream> 2 using namespace std; 3 4 const int maxn = 20000 + 10; 5 int n; 6 int DP[maxn]; 7 8 int max(int a,int b) 9 {10 return a > b ? a : b;11 }12 13 void. 阅读全文
posted @ 2012-09-12 15:21 pc.... 阅读(184) 评论(0) 推荐(0)