DP-背包
文章平均质量分 75
sunshine668
这个作者很懒,什么都没留下…
展开
-
hdu 2955 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 to原创 2014-05-16 22:02:48 · 409 阅读 · 0 评论 -
拦截导弹
题目描述:某国为了防御敌国的导弹袭击,开发出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭,并观测到导弹依次飞来的高度,请计算这套系统最多能拦截多少导弹。拦截来袭导弹时,必须按来袭导弹袭击的时间顺序,不允许先拦截后面的导弹,再拦截前面的导弹。 输入:每组原创 2016-03-06 17:37:02 · 349 阅读 · 0 评论 -
合唱队形
题目描述:N位同学站成一排,音乐老师要请其中的(N-K)位同学出列,使得剩下的K位同学不交换位置就能排成合唱队形。合唱队形是指这样的一种队形:设K位同学从左到右依次编号为1, 2, …, K,他们的身高分别为T1, T2, …, TK,则他们的身高满足T1 Ti+1 > … > TK (1 你的任务是,已知所有N位同学的身高,计算最少需要几位同学出列,可以使得剩下的同学排成合原创 2016-03-13 14:26:24 · 471 阅读 · 0 评论 -
poj 2184 Cow Exhibition
Description"Fat and docile, big and dumb, they look so stupid, they aren't much fun..." - Cows with Guns by Dana Lyons The cows want to prove to the public that they are both smart and fun原创 2014-11-30 13:43:49 · 298 阅读 · 0 评论 -
poj 2923 Relocation
DescriptionEmma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping them relocate. To move the furniture, they onl原创 2014-12-01 11:29:58 · 361 阅读 · 0 评论 -
hdu 2639 Bone Collector II
Problem DescriptionThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't seen it before,it doesn't m原创 2014-11-30 15:23:40 · 506 阅读 · 0 评论 -
hdu 2069 Coin Change
Problem DescriptionSuppose 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原创 2014-08-14 16:26:53 · 249 阅读 · 0 评论 -
hdu 1176免费馅饼 2151 Worm
Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个原创 2014-07-11 16:35:10 · 325 阅读 · 0 评论 -
hdu 2512 一卡通大冒险
Problem Description因为长期钻研算法, 无暇顾及个人问题,BUAA ACM/ICPC 训练小组的帅哥们大部分都是单身。某天,他们在机房商量一个绝妙的计划"一卡通大冒险"。这个计划是由wf最先提出来的,计划的内容是,把自己的联系方式写在校园一卡通的背面,然后故意将自己的卡"遗失"在某处(如水房,TD,食堂,主M。。。。)他们希望能有MM看到他们遗失卡,能主动跟他们联系,这样就有原创 2014-07-31 21:28:58 · 497 阅读 · 0 评论 -
hdu 2323 Honeycomb Walk
Problem DescriptionA bee larva living in a hexagonal cell of a large honeycomb decides to creep for a walk. In each “step” the larva may move into any of the six adjacent cells and after n steps, it原创 2014-08-06 20:09:29 · 852 阅读 · 0 评论 -
Coins
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 nearby原创 2014-07-11 13:45:39 · 403 阅读 · 0 评论 -
FATE 二维背包
Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他原创 2014-07-11 10:25:29 · 326 阅读 · 0 评论 -
悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺原创 2014-07-11 13:56:29 · 330 阅读 · 0 评论 -
hdu 1466 计算直线的交点数
Problem Description平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 Input输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n Output每个测试实例对应一行输出,从小到大列出所有相交方案,其中每个数为可能的交点数,每行的整数之间用一个空格原创 2014-08-03 19:33:05 · 329 阅读 · 0 评论 -
Robberies 01背包
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 to work i原创 2014-07-09 09:36:30 · 344 阅读 · 0 评论 -
Advanced Fruits
DescriptionThe company "21st Century Fruits" has specialized in creating new sorts of fruits by transferring genes from one fruit into the genome of another one. Most times this method doesn't w原创 2014-07-06 19:57:49 · 320 阅读 · 0 评论 -
poj 1948 Triangular Pasture
DescriptionLike everyone, cows enjoy variety. Their current fancy is new shapes for pastures. The old rectangular shapes are out of favor; new geometries are the favorite. I. M. Hei, the lead co原创 2014-05-17 13:09:21 · 394 阅读 · 0 评论 -
字符串编辑距离及另类
设A和B是2个字符串。要用最少的字符操作将字符串A转换为字符串B。这里所说的字符操作包括:(1)删除一个字符;(2)插入一个字符;(3)将一个字符改为另一个字符。将字符串A变换为字符串B所用的最少字符操作数称为字符串A到B的编辑距离dp[i][j]表示源串S[0...i]到目标串T[0...j]的最短编辑距离,则dp[i][0]=i;dp[0][j]=j;dp[原创 2016-07-13 21:55:37 · 1090 阅读 · 0 评论