动态规划-背包
IT-LittleM
这个作者很懒,什么都没留下…
展开
-
POJ1015-Jury Compromise(背包)
In Frobnia, a far-away country, the verdicts in court trials are determined by a jury consisting of members of the general public. Every time a trial is set to begin, a jury has to be selected, which ...原创 2020-04-05 17:07:17 · 122 阅读 · 0 评论 -
HDU3092-Least common multiple(数据划分+背包)
Partychen like to do mathematical problems. One day, when he was doing on a least common multiple(LCM) problem, he suddenly thought of a very interesting question: if given a number of S, and we divid...原创 2020-04-03 22:29:47 · 146 阅读 · 0 评论 -
HDU 2955-Robberies(互斥事件+01背包)
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 become too greedy. He has decided to work in the lucrative...原创 2020-04-03 15:52:16 · 254 阅读 · 0 评论 -
HDU2844-Coins(多重背包+二进制优化+01背包)
Whuacmers 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 nearby shop. He wanted ...原创 2020-04-03 14:34:50 · 161 阅读 · 0 评论 -
HDU2159-FATE
最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗? Inpu...原创 2020-03-29 21:20:16 · 158 阅读 · 0 评论 -
HDU1864-最大报销额
现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。 Input 测试输入包含若干测试用例。每个测试用例的第1行包含两个正数 Q 和 N,其中 Q 是给定的报销额度,N(<=30)是发...原创 2020-03-29 17:26:12 · 209 阅读 · 0 评论 -
HDU2182-Frog(二维费用背包)
A little frog named Fog is on his way home. The path’s length is N (1 <= N <= 100), and there are many insects along the way. Suppose the original coordinate of Fog is 0. Fog can stay still or j...原创 2020-03-28 15:07:46 · 183 阅读 · 0 评论 -
HDU2069-Coin Change(二维费用背包)
Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money. For example, if we have 11 cents, then we can m...原创 2020-03-27 23:35:49 · 418 阅读 · 0 评论