背包问题
文章平均质量分 81
h1021456873
这个作者很懒,什么都没留下…
展开
-
hdu Robberies (背包)
Problem DescriptionThe 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 become too greedy. He has decided t原创 2015-07-24 19:36:56 · 572 阅读 · 1 评论 -
hdu 饭卡 (背包)
Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。Inp原创 2015-07-24 19:35:28 · 836 阅读 · 1 评论 -
hdu An easy problem (背包)
Problem DescriptionWhen Teddy was a child , he was always thinking about some simple math problems ,such as “What it’s 1 cup of water plus 1 pile of dough ..” , “100 yuan buy 100 pig” .etc..原创 2015-07-24 19:39:11 · 437 阅读 · 0 评论 -
hdu Piggy-Bank (背包)
Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). Th原创 2015-07-24 19:39:02 · 471 阅读 · 0 评论 -
51nod 1101 换零钱 (0-1背包,DP)
1101 换零钱基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 关注N元钱换为零钱,有多少不同的换法?币值包括1 2 5分,1 2 5角,1 2 5 10 20 50 100元。例如:5分钱换为零钱,有以下4种换法:1、5个1分2、1个2分3个1分3、2个2分1个1分4、1原创 2015-10-30 14:02:04 · 972 阅读 · 0 评论 -
HDU 攻城堡 (依赖背包+树形dp)
Problem DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗?Input每个测试实例首先包括2个整数,N,M.原创 2016-02-27 21:11:02 · 593 阅读 · 1 评论 -
UVA 562 分钱(01背包)
DescriptionIt's commonly known that the Dutch have invented copper-wire. Two Dutch men were fighting over a nickel, which was made of copper. They were both so eager to get it and the fighting原创 2016-03-13 00:05:12 · 339 阅读 · 1 评论 -
cf19B Checkout Assistant (01背包_好题)
题意:有n个商品,每个商品都有一个付款时间t,和一个价值p,付款的时候可以偷走一个东西,花费1时间....问所以商品获得后最少要花多少钱...转换一下啊思路,这题就是已知一个商品单价p,同时送t个物品,即p元可以买t+1个商品,问n个商品买完,至少要花多少钱...操蛋,想了一天,最后还是看题解才搞定的////...那么其实很简单,就是一个01背包问题原创 2016-04-06 15:39:26 · 1055 阅读 · 0 评论