DP
文章平均质量分 78
Zhac
菜菜菜
展开
-
hdoj1003 Max Sum
Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 +原创 2016-03-08 11:38:30 · 256 阅读 · 0 评论 -
HDU1176免费馅饼(dp数塔)
Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高手,原创 2016-08-09 08:39:28 · 238 阅读 · 0 评论 -
HDU1260Tickets(dp)
DescriptionJesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when could he go back hom原创 2016-08-08 17:42:13 · 548 阅读 · 0 评论 -
HDU1003Max Sum(dp)
DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.原创 2016-08-08 16:17:35 · 206 阅读 · 0 评论 -
HDU1231最大连续子序列(dp)
Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和 为20。 在今年的数据结构考卷中,要求编写程序得到最大和,现在增加一个要求,即还需要输出该 子序原创 2016-08-08 15:51:07 · 608 阅读 · 0 评论 -
HDU2059龟兔赛跑(dp)
Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修炼,终于练成了绝技,能够毫不休息得以恒定的速度(VR m/s)一直跑。兔子一直想找机会好好得教训一下乌龟,以雪前耻。最近正值HDU举办50周年校庆,社会各大名流齐聚下沙,兔子也趁此机会向乌龟发起挑战。虽然乌龟深知获胜希望不大,不原创 2016-08-08 15:14:19 · 264 阅读 · 0 评论 -
hdoj2084数塔(dp)
Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗?Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 Ou原创 2016-03-09 17:50:49 · 413 阅读 · 0 评论 -
LightOJ 1198Karate Competition(动态规划+dp)
Your karate club challenged another karate club in your town. Each club enters N players into the match, and each player plays one game against a player from the other team. Each game that is won is w原创 2016-08-01 08:38:11 · 288 阅读 · 0 评论 -
hdu-1052Tian Ji -- The Horse Racing(贪心,dp)
DescriptionHere is a famous story in Chinese history. "That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and other转载 2016-07-23 19:14:26 · 344 阅读 · 0 评论 -
POJ1745Divisibility(dp)
DescriptionConsider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expressions that evaluate to different va原创 2016-08-09 09:32:50 · 256 阅读 · 0 评论