背包
文章平均质量分 61
Twenty_seven
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 2955 01背包
如题: http://acm.hdu.edu.cn/showproblem.php?pid=2955 The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they原创 2015-01-16 19:54:56 · 384 阅读 · 0 评论 -
poj1742 单调队列优化多重背包
如题:http://poj.org/problem?id=1742 Coins Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 31258 Accepted: 10640 Description People in Silverland use coins.The转载 2015-08-04 23:15:23 · 576 阅读 · 0 评论 -
poj2184 负容量01背包
如题:http://poj.org/problem?id=2184 Cow Exhibition Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10296 Accepted: 4024 Description "Fat and docile, big and d原创 2015-08-07 14:38:21 · 626 阅读 · 0 评论 -
poj1014 多重背包
如题:http://poj.org/problem?id=1014 Dividing Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 62483 Accepted: 16183 Description Marsha and Bill own a collectio原创 2015-04-21 23:18:42 · 390 阅读 · 0 评论 -
hdu2191 多重背包
如题:http://acm.hdu.edu.cn/showproblem.php?pid=2191 Problem Description 急!灾区的食物依然短缺! 为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。 请问:你用有限的资金最多能采购多少公斤粮食呢? 后记原创 2015-01-26 10:29:01 · 432 阅读 · 0 评论 -
hdu 2844 多重背包
如题:http://acm.hdu.edu.cn/showproblem.php?pid=2844 Problem Description Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there原创 2015-01-26 14:48:50 · 613 阅读 · 0 评论 -
hDU1248 完全背包
如题: http://acm.hdu.edu.cn/showproblem.php?pid=1248 Problem Description 不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前. 死亡骑士:"我要买道具!" 地精商人:"我们这里有三种道具,血瓶150块一个,魔法药原创 2015-01-22 21:08:11 · 463 阅读 · 0 评论 -
POJ 1384 完全背包
如题:http://poj.org/problem?id=1384 Description Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from I原创 2015-01-22 21:36:23 · 423 阅读 · 0 评论 -
POJ2063 完全背包
如题:http://poj.org/problem?id=2063 题目给出初始金额和年利率,要求求出在X年内的最大收益 本金都是1000的倍数所以1000000/1000=1000,(The value of a bond is always a multiple of $1 000.)加上每年的收益绝对是小于本金的,(The interest of a bond i原创 2015-01-23 11:11:52 · 510 阅读 · 0 评论 -
hdu4508 完全背包
如题:http://acm.hdu.edu.cn/showproblem.php?pid=4508 Problem Description 对于吃货来说,过年最幸福的事就是吃了,没有之一! 但是对于女生来说,卡路里(热量)是天敌啊! 资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。 当然,为了原创 2015-01-22 11:56:29 · 657 阅读 · 0 评论 -
HDU 1171 01背包
如题:http://acm.hdu.edu.cn/showproblem.php?pid=1171 给出的是物品的价值和物品的数量 要求 将总价值分成2分 并且最接近 物品拆成1件一件 容量sum/2 然后背包即可 #include #include #include using namespace std; #define MAXV 250050 #define M原创 2015-01-17 14:33:07 · 665 阅读 · 0 评论 -
POJ 3624 01背包
如题http://poj.org/problem?id=3624 最基础的01背包 #include #include #include using namespace std; #define MAXN 3500 #define MAXV 13000 #define max(a,b)(a>b?a:b) int N,M; int c[MAXN]; int w[MAXN原创 2015-01-17 13:43:36 · 434 阅读 · 0 评论 -
HDU1864 01背包
如题:http://acm.hdu.edu.cn/showproblem.php?pid=1864 Problem Description 现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的原创 2015-01-18 09:36:45 · 495 阅读 · 0 评论 -
HDU3466 01背包
如题: http://acm.hdu.edu.cn/showproblem.php?pid=3466 Problem Description Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the worl原创 2015-01-17 18:29:22 · 408 阅读 · 0 评论 -
poj 1742 多重背包(单调队列)
如题:http://poj.org/problem?id=1742 ,...又是这道题 ,第一种方法是二进制拆分多重背包,第二种是原创 2015-01-27 22:34:50 · 679 阅读 · 0 评论 -
poj1276 多重背包
如题:http://poj.org/problem?id=1276 Description A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine us原创 2015-01-31 10:33:32 · 473 阅读 · 0 评论 -
poj3260 混合背包
如题:http://poj.org/problem?id=3260 Description Farmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the small原创 2015-01-31 18:02:57 · 540 阅读 · 0 评论 -
hdu2639 01背包第k优解
如题:http://acm.hdu.edu.cn/showproblem.php?pid=2639 Problem Description The title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem t原创 2015-01-12 10:52:45 · 537 阅读 · 0 评论 -
poj2392 多重背包
如题:http://poj.org/problem?id=2392 给出几种石头的每个的高度,使用当前石头不允许超过的最大高度,石头的数量,要求求所有石头最大能组成的高度。 首先由最大高度最小的那组拿石头,最后从最大高度最大的那组拿,保证了背包容量的不断增加,使得dp关系成立。 dp策略:当前最大高度是否可以达到,,这里使用了辅助数组used,used[i]代表了当前高度i之前使原创 2015-01-31 10:19:42 · 550 阅读 · 0 评论 -
hdu2546 01背包
如题:http://acm.hdu.edu.cn/showproblem.php?pid=2546 当饭卡里的钱数不足5元 什么都不能买,直接输出钱数 否则 升序排序,max是最之前的菜的钱数 钱数先减去5,然后01背包在(1.。。n-1)个菜中计算最高花费,最后输出m+5-f[m]-max #include #include #include #include using原创 2015-01-11 18:21:22 · 429 阅读 · 0 评论 -
hdu2602 01背包
开始背包专题,先从简单的来吧 如题:http://acm.hdu.edu.cn/showproblem.php?pid=2602 #include #include #include using namespace std; #define MN 1002 #define MV 1002 #define max(a,b)(a>b?a:b) i原创 2015-01-11 17:17:48 · 483 阅读 · 0 评论 -
poj 1787 记录路径的多重背包
如题:http://poj.org/problem?id=1787 Description Charlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffee at coffee vending machines at motorests. Charli原创 2015-01-29 19:26:03 · 577 阅读 · 0 评论 -
hdu1171多重背包
之前用01背包做,现在用多重背包再来一次http://blog.youkuaiyun.com/twenty_seven/article/details/42805157(01背包) #include #include #include using namespace std; int w[55]; int num[55]; int f[50*50*100/2+50];原创 2015-01-28 00:12:15 · 466 阅读 · 0 评论 -
hdu1059 多重背包
如题:http://acm.hdu.edu.cn/showproblem.php?pid=1059 Problem Description Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equ原创 2015-01-28 13:19:27 · 424 阅读 · 0 评论 -
poj1742 多重背包单调队列
如题:http://poj.org/problem?id=1742 Description People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coin原创 2015-01-28 02:02:13 · 576 阅读 · 0 评论 -
hdu1171 多重背包
如题:http://acm.hdu.edu.cn/showproblem.php?pid=1171 Problem Description Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College ha原创 2015-01-28 01:57:48 · 479 阅读 · 0 评论 -
hdu2159 二维完全背包
如题http://acm.hdu.edu.cn/showproblem.php?pid=2159 第一次遇到多维的背包,其实只是多种因素同时限制最终背包值。 比如这一题,二维,加一重循环并找准上一层的状态就行了。代码一看就能会。 #include #include #include using namespace std; #define max(a,b)(原创 2015-01-28 01:49:19 · 601 阅读 · 0 评论
分享