
动态规划
SCUT_Pein
这个作者很懒,什么都没留下…
展开
-
HDU1257--最少拦截系统
Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求原创 2013-04-07 00:07:08 · 771 阅读 · 0 评论 -
POJ1088--滑雪
DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 714 2原创 2013-05-22 14:21:21 · 646 阅读 · 0 评论 -
POJ1050--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 rectangle原创 2013-05-18 15:29:14 · 769 阅读 · 0 评论 -
HDU4293--Groups
Description After the regional contest, all the ACMers are walking alone a very long avenue to the dining hall in groups. Groups can vary in size for kinds of reasons, which means, several player原创 2013-05-18 11:59:24 · 874 阅读 · 0 评论 -
POJ1014--多重背包--Dividing
DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the marbles h原创 2013-03-27 18:40:06 · 861 阅读 · 0 评论 -
POJ1742--Coins
DescriptionPeople in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nice wat原创 2013-03-27 17:48:10 · 979 阅读 · 0 评论 -
HDU1074--Doing Homework
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in原创 2013-04-09 19:23:59 · 663 阅读 · 0 评论 -
Maximum Contiguous Mum I
DescriptionThere are N intergers make up a loop, your job is calculate the max sum of contiguous sub-suquence in the loop. Note, you can select a null sub-suquence.For example, given(3, 1, -5, 2原创 2013-03-25 11:27:46 · 687 阅读 · 0 评论 -
HDU1978--How many ways
Problem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。原创 2013-04-08 23:33:32 · 760 阅读 · 0 评论 -
HDU1081--To The Max
Problem DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or greater located within the whole array. The sum of a原创 2013-04-09 09:02:35 · 607 阅读 · 0 评论 -
HDU1789--Doing Homework again
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in原创 2013-04-08 14:47:52 · 689 阅读 · 0 评论 -
HDU2845--Beans
Problem DescriptionBean-eating is an interesting game, everyone owns an M*N matrix, which is filled with different qualities beans. Meantime, there is only one bean in any 1*1 grid. Now you want to原创 2013-04-08 14:12:49 · 777 阅读 · 0 评论 -
HDU2577--How to Type
Problem DescriptionPirates have finished developing the typing software. He called Cathy to test his typing software. She is good at thinking. After testing for several days, she finds that if she t原创 2013-04-08 12:00:17 · 794 阅读 · 0 评论 -
HDU2830--Matrix Swapping II
Problem DescriptionGiven an N * M matrix with each entry equal to 0 or 1. We can find some rectangles in the matrix whose entries are all 1, and we define the maximum area of such rectangle as this原创 2013-04-06 19:17:03 · 836 阅读 · 0 评论 -
HDU1069--Monkey and Banana
Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with som原创 2013-04-06 10:53:45 · 745 阅读 · 0 评论 -
HDU--2870--Largest Submatrix
Problem DescriptionNow here is a matrix with letter 'a','b','c','w','x','y','z' and you can change 'w' to 'a' or 'b', change 'x' to 'b' or 'c', change 'y' to 'a' or 'c', and change 'z' to 'a', 'b' o原创 2013-04-07 09:20:54 · 682 阅读 · 0 评论 -
POJ2063--Investment
DescriptionJohn never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that John wa原创 2013-03-22 19:24:29 · 712 阅读 · 0 评论 -
POJ1018--Communication System
DescriptionWe have received an order from Pizoor Communications Inc. for a special communication system. The system consists of several devices. For each device, we are free to choose from several原创 2013-05-22 12:45:10 · 798 阅读 · 0 评论 -
POJ1083--Moving Tables
DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms each on the north side and south原创 2013-05-22 13:53:05 · 848 阅读 · 0 评论 -
POJ2948--Martian Mining
DescriptionThe NASA Space Center, Houston, is less than 200 miles from San Antonio, Texas (the site of the ACM Finals this year). This is the place where the astronauts are trained for Mission Sev原创 2013-07-25 20:34:42 · 776 阅读 · 0 评论 -
ZOJ3211--Dream City
DescriptionJAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There are n trees in the yard. Let's call them tree 1, tree 2 ...and tree n. At the first day, each tree i has ai c原创 2014-07-21 20:50:26 · 810 阅读 · 0 评论 -
POJ3356--AGTC(edit distance)动态规划
DescriptionLet x and y be two strings over some finite alphabet A. We would like to transform x into y allowing only operations given below:Deletion: a letter in x is missing in y at a cor原创 2014-04-27 20:01:46 · 618 阅读 · 0 评论 -
HDU1423--Greatest Common Increasing Subsequence(LCIS)
Problem DescriptionThis is a problem from ZOJ 2432.To make it easyer,you just need output the length of the subsequence. InputEach sequence is described with M - its length (1原创 2014-04-26 21:54:58 · 800 阅读 · 0 评论 -
POJ2964--Tourist双重动态规划
DescriptionA lazy tourist wants to visit as many interesting locations in a city as possible without going one step further than necessary. Starting from his hotel, located in the north-west corne原创 2014-04-25 20:05:18 · 1257 阅读 · 0 评论 -
CF237D Minesweeper 1D
Game "Minesweeper 1D" is played on a line of squares, the line's height is 1 square, the line's width is n squares. Some of the squares contain bombs. If a square doesn't contain a bomb, then it con原创 2014-03-20 15:59:52 · 765 阅读 · 0 评论 -
HDU3024--Repairman
Problem DescriptionThe traveling repairman problem (TRP) is classical NP-Hard problem, which is also known as minimum latency problem (MLP) and delivery man problem. Suppose that we have a graph w原创 2014-03-18 16:09:22 · 731 阅读 · 0 评论 -
HDU1244--Max Sum Plus Plus Plus
Problem Description给定一个由n个正整数组成的整数序列a1 a2 a3 ... an求按先后次序在其中取m段长度分别为l1、l2、l3...lm的不交叠的连续整数的和的最大值。Input第一行是一个整数n(0 ≤ n ≤ 1000),n = 0表示输入结束第二行的第一个数是m(1 ≤ m ≤ 20),第二行接下来有m个整数l1,l2原创 2013-11-24 20:25:19 · 907 阅读 · 0 评论 -
HDU1024--Max Sum Plus Plus
Problem DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more diff原创 2013-11-24 20:23:52 · 825 阅读 · 0 评论 -
POJ1185--炮兵阵地
Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),也可能是平原(用"P"表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示:如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑色的网原创 2013-11-21 16:54:17 · 769 阅读 · 0 评论 -
POJ3140--Contestants Division
DescriptionIn the new ACM-ICPC Regional Contest, a special monitoring and submitting system will be set up, and students will be able to compete at their own universities. However there’s one prob原创 2013-07-27 16:01:09 · 802 阅读 · 0 评论 -
POJ2486--Apple Tree
DescriptionWshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple tree. There are N nodes in the tree. Each node has an amount of apples. Wshxzt starts her happy trip a原创 2013-07-27 10:20:36 · 751 阅读 · 0 评论 -
POJ1947--Rebuilding Roads
DescriptionThe cows have reconstructed Farmer John's farm, with its N barns (1 <= N <= 150, number 1..N) after the terrible earthquake last May. The cows didn't have time to rebuild any extra road原创 2013-07-26 20:02:54 · 868 阅读 · 0 评论 -
POJ2411--Mondriaan's Dream
DescriptionSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series' (where he had to use his toilet paper to draw o原创 2013-07-26 18:15:04 · 765 阅读 · 0 评论 -
POJ3254--Corn Fields
DescriptionFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squar原创 2013-07-26 14:59:11 · 836 阅读 · 0 评论 -
POJ3034--Whac-a-Mole
DescriptionWhile visiting a traveling fun fair you suddenly have an urge to break the high score in the Whac-a-Mole game. The goal of the Whac-a-Mole game is to… well… whack moles. With a hammer原创 2013-07-26 12:45:16 · 1005 阅读 · 0 评论 -
POJ1925--Spiderman
DescriptionDr. Octopus kidnapped Spiderman's girlfriend M.J. and kept her in the West Tower. Now the hero, Spiderman, has to reach the tower as soon as he can to rescue her, using his own weapon,原创 2013-07-26 10:54:55 · 857 阅读 · 0 评论 -
HDU1160--FatMouse's Speed
Problem DescriptionFatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as pos原创 2013-04-07 01:30:45 · 758 阅读 · 0 评论 -
HDU1171--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 Softwar原创 2013-04-06 11:22:56 · 754 阅读 · 0 评论 -
HDU1421--搬寝室
Problem Description搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和原创 2013-04-07 11:11:50 · 829 阅读 · 0 评论 -
POJ1080--Human Gene Functions
DescriptionIt is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interest原创 2013-03-14 18:43:59 · 735 阅读 · 0 评论