动态规划
文章平均质量分 66
ultimater
桃李争辉飒爽英姿斗艳,成功失败总是欢乐伤悲!
展开
-
HDU 1158 Common Subsequence
Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there e原创 2012-07-12 18:28:27 · 1742 阅读 · 0 评论 -
HDU 1267 下沙的沙子有几粒?
Problem Description2005年11月份,我们学校参加了ACM/ICPC 亚洲赛区成都站的比赛,在这里,我们获得了历史性的突破,尽管只是一枚铜牌,但获奖那一刻的激动,也许将永远铭刻在我们几个人的心头。借此机会,特向去年为参加ACM亚洲赛而艰苦集训了近半年的各位老队员表示感谢。实际上,除了获奖以外,在这次比赛期间还有一件事也让我们记忆深刻。那是比赛当天等待入场的时候,听到原创 2012-08-28 20:59:57 · 651 阅读 · 0 评论 -
HDU 2151 Worm
Problem Description自从见识了平安夜苹果的涨价后,Lele就在他家门口水平种了一排苹果树,共有N棵。突然Lele发现在左起第P棵树上(从1开始计数)有一条毛毛虫。为了看到毛毛虫变蝴蝶的过程,Lele在苹果树旁观察了很久。虽然没有看到蝴蝶,但Lele发现了一个规律:每过1分钟,毛毛虫会随机从一棵树爬到相邻的一棵树上。比如刚开始毛毛虫在第2棵树上,过1分钟后,原创 2012-09-05 11:54:25 · 1101 阅读 · 0 评论 -
HDU 1203 I NEED A OFFER!
DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了他得到这个学校o原创 2012-07-31 21:25:05 · 647 阅读 · 0 评论 -
HDU 1114 Piggy-Bank
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 idea b原创 2012-07-31 17:44:03 · 785 阅读 · 0 评论 -
HDU 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴原创 2012-07-29 17:16:56 · 3759 阅读 · 0 评论 -
HDU 1171 Big Event in HDU
Problem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Softw原创 2012-07-29 16:50:49 · 698 阅读 · 0 评论 -
HDU 2602 Bone Collector
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 grav原创 2012-07-27 16:52:01 · 580 阅读 · 0 评论 -
POJ 2479 Maximum sum
DescriptionGiven a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below:Your task is to calculate d(A).InputThe input consists of T(Each test case contains two l原创 2012-08-07 22:28:40 · 789 阅读 · 0 评论 -
HDU 2159 FATE
Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只原创 2012-07-21 22:01:38 · 1435 阅读 · 3 评论 -
POJ 3624 Charm Bracelet
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each原创 2012-08-05 23:09:34 · 573 阅读 · 0 评论 -
POJ To the Max
DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangl原创 2012-08-05 22:04:39 · 1031 阅读 · 0 评论 -
POJ 1163 The Triangle
Description73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that st原创 2012-08-05 22:45:39 · 536 阅读 · 0 评论 -
HDU 2084 数塔
Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗? Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1原创 2012-08-05 16:30:53 · 2519 阅读 · 0 评论 -
HDU 1248 寒冰王座
Problem Description不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前.死亡骑士:"我要买道具!"地精商人:"我们这里有三种道具,血瓶150块一个,魔法药200块一个,无敌药水350块一个."死亡骑士:"好的,给我一个血瓶."说完他掏出那张原创 2012-08-05 15:55:01 · 1121 阅读 · 0 评论 -
UVALive 5066 Fire Drill
DescriptionJoko is taking part in a fire drill which is held by the Jakarta Fire Department to recruit new firemen. The drill is about rescuing volunteers (who act as unconscious people) trapp原创 2012-08-05 15:09:54 · 794 阅读 · 0 评论 -
HDU 1712 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-07-20 23:57:39 · 816 阅读 · 0 评论 -
HDU 1087 Super Jumping! Jumping! Jumping!
Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to原创 2012-09-06 23:23:56 · 750 阅读 · 0 评论