![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DP及贪心题
码院
这个作者很懒,什么都没留下…
展开
-
悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包问题)2191 HDU
Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺原创 2012-08-11 18:41:43 · 1481 阅读 · 0 评论 -
HDU2059
Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好好得教训一下乌龟,以雪前耻。最近正值HDU举办50周年校庆,社会各大名流齐聚下沙,兔子也趁此机会向乌龟发起挑战。虽然乌龟深知原创 2012-08-21 20:18:00 · 3969 阅读 · 1 评论 -
活动安排问题
作为新一代的好青年肯定会喜欢许多的电视节目,比如说新闻联播,焦点访谈,又如招聘类的节目有非你莫属,职来职往,娱乐节目如快乐大本营。现在给你每个节目的开始时间和结束时间,要求你求出看尽可能多的完整节目。 每个电视节目i都有一个起始时间si和一个结束时间fi,且si 对于活动安排问题可以用贪心算法解决,我们把节目的结束时间按非减序排列,所以算法greedySele原创 2012-08-20 20:17:58 · 1713 阅读 · 0 评论 -
I love sneakers! 分组背包(每组至少选一件)
Problem Description After months of hard working, Iserlohn finally wins awesome amount of scholarship. As a great zealot of sneakers, he decides to spend all his money on them in a sneaker store原创 2012-08-18 16:55:32 · 1139 阅读 · 0 评论 -
FATE
Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只原创 2012-08-17 21:44:26 · 539 阅读 · 0 评论 -
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原创 2012-08-17 21:11:17 · 853 阅读 · 0 评论 -
Coins 多重背包
Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a原创 2012-08-17 20:07:47 · 1237 阅读 · 1 评论 -
ACboy needs your help 分组背包
Problem DescriptionACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different course depending on the days he spend on it.How to原创 2012-08-18 15:26:37 · 1237 阅读 · 0 评论 -
I NEED A OFFER! 01背包
Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了原创 2012-08-17 10:11:23 · 501 阅读 · 0 评论 -
Piggy-Bank HDU1114
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). The原创 2012-08-11 18:39:56 · 500 阅读 · 0 评论 -
Bone Collector 2602 01背包问题
Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave原创 2012-08-11 18:37:30 · 532 阅读 · 0 评论 -
HDU2546 01背包
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2546 解题思路:要使得买饭后卡上的余额达到最小,但由于有限制条件就是卡上的必须剩下不小于5元才能买饭,这样的情况用01背包是肯定错误的得不到最优的解,我们知道要使得卡上余额最小那就是要让最贵的菜最后买,所以剩下来的n-1种菜就可以用01背包求解了 #includeusing nam原创 2012-08-22 20:08:27 · 660 阅读 · 0 评论