摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1114完全背包#include#include#includeusing namespace std;const int MAXN=999999999;int main(void){ int i,j,... 阅读全文
posted @ 2014-11-16 20:47 立刻行动 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2191多重背包问题: 思路:直接转换为01背包问题代码#include#include#includeusing namespace std;int main(void){ int i,j,k,l,n... 阅读全文
posted @ 2014-11-16 19:19 立刻行动 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2602题意tn v //n代表数量,v 代表背包的体积v1 v2......vn//价值m1 m2 ...... mn// 体积求最大的价值01背包裸题代码#include#include#includeu... 阅读全文
posted @ 2014-11-16 15:53 立刻行动 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1171题目大意: n种设备,每种设备价值为v 数量为m 希望 以最小的差距分成两堆 第一堆不能比第二堆少,开始看完这题让我想起了小时候与朋友一起去摘野果后分野果,就是我先拿一个,拿最大的,朋友再拿一个,也... 阅读全文
posted @ 2014-11-16 15:21 立刻行动 阅读(131) 评论(0) 推荐(0) 编辑