DP
文章平均质量分 81
键盘上的舞者
这个作者很懒,什么都没留下…
展开
-
POJ2533:Longest Ordered Subsequence
DescriptionA numeric sequence of ai is ordered ifa1 <a2 aN. Let the subsequence of the given numeric sequence (a1,a2, ...,aN) be any sequence (ai1,ai2, ...,aiK), where 1 i1 i2 < ... <iK N. F原创 2013-03-13 19:19:00 · 1265 阅读 · 0 评论 -
POJ1163: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 t原创 2013-03-12 19:42:18 · 3217 阅读 · 4 评论 -
HDU1503:Advanced Fruits(LCS)
Problem 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原创 2013-07-29 17:17:33 · 5762 阅读 · 2 评论 -
POJ2533:Longest Ordered Subsequence(LIS)
DescriptionA numeric sequence of ai is ordered ifa1 a2 aN. Let the subsequence of the given numeric sequence (a1,a2, ..., aN) be any sequence (ai1,ai2, ..., aiK), where 1 <=i1 i2 iK <=N. F原创 2013-07-29 20:50:53 · 5605 阅读 · 0 评论 -
HDU1423:Greatest Common Increasing Subsequence(LICS)
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 Output原创 2013-07-29 22:14:24 · 2038 阅读 · 0 评论 -
HDU1159 && POJ1458:Common Subsequence(LCS)
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 exi原创 2013-07-29 16:04:56 · 1729 阅读 · 0 评论 -
HDU1257:最少拦截系统(LIS)
Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求原创 2013-07-30 13:56:39 · 1610 阅读 · 0 评论 -
POJ2250:Compromise(LCS)
DescriptionIn a few months the European Currency Union will become a reality. However, to join the club, the Maastricht criteria must be fulfilled, and this is not a trivial task for the countries (原创 2013-07-30 14:55:22 · 2960 阅读 · 1 评论 -
HDU1025:Constructing Roads In JGShining's Kingdom(LIS)
Problem DescriptionJGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines.Half of these cities are rich in resource (we call them rich原创 2013-07-30 17:18:31 · 2267 阅读 · 0 评论 -
HDU4512:吉哥系列故事——完美队形I(LICS)
Problem Description 吉哥这几天对队形比较感兴趣。 有一天,有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则称之为完美队形: 1、挑出的人保持他们在原队形的相对顺序不变; 2、左右对称,假设有m个人形成新的队形,则第1个人和第m个人身原创 2013-07-30 16:22:27 · 2234 阅读 · 0 评论 -
POJ3903:Stock Exchange(LIS)
DescriptionThe world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is very concerned about the evolution of the stock exch原创 2013-07-30 21:51:55 · 2920 阅读 · 0 评论 -
HDU1950:Bridging signals(LIS)
Problem Description'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the signals on the chip原创 2013-07-30 22:09:30 · 2717 阅读 · 0 评论 -
HDU4521:小明系列问题——小明序列(LIS加强版)
Problem Description 大家都知道小明最喜欢研究跟序列有关的问题了,可是也就因为这样,小明几乎已经玩遍各种序列问题了。可怜的小明苦苦地在各大网站上寻找着新的序列问题,可是找来找去都是自己早已研究过的序列。小明想既然找不到,那就自己来发明一个新的序列问题吧!小明想啊想,终于想出了一个新的序列问题,他欣喜若狂,因为是自己想出来的,于是将其新序列问题命名为“小明序列”。原创 2013-07-31 11:37:01 · 3125 阅读 · 0 评论 -
POJ2955:Brackets(区间DP)
DescriptionWe give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence, if s is a regular brackets sequence, then (s) and [s]原创 2013-07-31 21:40:34 · 4149 阅读 · 0 评论 -
HDU4570:Multi-bit Trie(区间DP)
Problem Description IP lookup is one of the key functions of routers for packets forwarding and classifying. Generally, IP lookup can be simplified as a Longest Prefix Matching (LPM) problem. That'原创 2013-08-01 15:20:15 · 2711 阅读 · 0 评论 -
HDU2476:String painter(区间DP)
Problem DescriptionThere are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of the painter, you can chan原创 2013-08-02 00:36:52 · 8953 阅读 · 4 评论 -
HDU4283:You Are the One(区间DP)
Problem Description The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the show itself. The show is hold in the Small hall原创 2013-08-02 21:24:27 · 5045 阅读 · 1 评论 -
HDU4632:Palindrome subsequence(区间DP)
Problem DescriptionIn mathematics, a subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. For example,原创 2013-08-03 11:11:26 · 2836 阅读 · 2 评论 -
POJ3186:Treats for the Cows(区间DP)
DescriptionFJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the money he receives over a原创 2013-08-03 20:50:59 · 6243 阅读 · 1 评论 -
POJ3056:The Bavarian Beer Party(区间DP)
DescriptionThe professors of the Bayerische Mathematiker Verein have their annual party in the local Biergarten. They are sitting at a round table each with his own pint of beer. As a ceremony each原创 2013-08-03 16:34:05 · 1724 阅读 · 0 评论 -
HDU1513 && POJ1159:Palindrome(LCS)
Problem DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determ原创 2013-07-29 18:16:04 · 2846 阅读 · 1 评论 -
POJ2127:Greatest Common Increasing Subsequence(LICS)
DescriptionYou are given two sequences of integer numbers. Write a program to determine their common increasing subsequence of maximal possible length.Sequence S1 , S2 , . . . , SN of length N i原创 2013-07-30 10:02:25 · 1888 阅读 · 0 评论 -
POJ1651:Multiplication Puzzle(区间DP)
DescriptionThe multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of points eq原创 2013-08-04 15:24:28 · 7447 阅读 · 0 评论 -
HDU1208:Pascal's Travels(DP)
Problem DescriptionAn n x n game board is populated with integers, one nonnegative integer per square. The goal is to travel along any legitimate path from the upper left corner to the lower right c原创 2013-08-04 23:30:58 · 2318 阅读 · 0 评论 -
ZOJ3706:Break Standard Weight(DP)
The balance was the first mass measuring instrument invented. In its traditional form, it consists of a pivoted horizontal lever of equal length arms, called the beam, with a weighing pan, also called原创 2013-08-06 23:30:33 · 2595 阅读 · 1 评论 -
ZOJ3551:Bloodsucker(概率DP)
n 0th day, there are n-1 people and 1 bloodsucker. Every day, two and only two of them meet. Nothing will happen if they are of the same species, that is, a people meets a people or a bloodsucker meet原创 2013-08-19 00:17:12 · 2384 阅读 · 0 评论 -
POJ2342:Anniversary party(树形DP)
DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relati原创 2013-08-07 11:21:51 · 6854 阅读 · 8 评论 -
POJ2486:Apple Tree(树形DP)
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-08-20 11:38:06 · 4641 阅读 · 5 评论 -
ZOJ3582:Back to the Past(概率DP)
Recently poet Mr. po encountered a serious problem, rumor said some of his early poems are written by others. This brought a lot of trouble to Mr. po, so one day he went to his best friend MasterO for原创 2013-08-19 16:56:37 · 1205 阅读 · 0 评论 -
HDU3709:Balanced Number(数位DP+记忆化DFS)
Problem DescriptionA balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the di原创 2013-08-20 19:13:42 · 3844 阅读 · 0 评论 -
POJ1947:Rebuilding Roads(树形DP)
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 roads,原创 2013-08-08 12:19:18 · 5850 阅读 · 3 评论 -
POJ1655:Balancing Act(树形DP)
DescriptionConsider a tree T with N (1 <= N <= 20,000) nodes numbered 1...N. Deleting any node from the tree yields a forest: a collection of one or more trees. Define the balance of a node to be th原创 2013-08-08 16:49:08 · 1555 阅读 · 0 评论 -
HDU1561:The more, The Better(树形DP+01背包)
Problem DescriptionACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的宝物应该攻克哪M个城堡吗? Input每个测试实例首先包括2个整数,N,M.(原创 2013-08-09 10:58:15 · 2415 阅读 · 0 评论 -
HDU2196:Computer(树形DP)
Problem DescriptionA school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one o原创 2013-08-09 17:52:47 · 2193 阅读 · 0 评论 -
CSU1120:病毒(LICS)
http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1120 Description你有一个日志文件,里面记录着各种系统事件的详细信息。自然的,事件的时间戳按照严格递增顺序排列(不会有两个事件在完全相同的时刻发生)。遗憾的是,你的系统被病毒感染了,日志文件中混入了病毒生成的随机伪事件(但真实事件的相对顺序保持不变)。备份的日志文件也原创 2013-08-09 18:14:59 · 9979 阅读 · 0 评论 -
HDU2412 && POJ3342:Party at Hali-Bula(树形DP)
DescriptionDear Contestant,I'm going to have a party at my villa at Hali-Bula to celebrate my retirement from BCM. I wish I could invite all my co-workers, but imagine how an employee can enjo原创 2013-08-07 18:52:30 · 1781 阅读 · 0 评论 -
HDU1011:Starship Troopers(树形DP)
Problem DescriptionYou, the leader of Starship Troopers, are sent to destroy a base of the bugs. The base is built underground. It is actually a huge cavern, which consists of many rooms connected w原创 2013-08-10 14:18:27 · 7436 阅读 · 4 评论 -
HDU1054 && POJ1463:Strategic game(树形DP)
DescriptionBob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must def原创 2013-08-07 23:50:44 · 3035 阅读 · 0 评论 -
HDU4003:Find Metal Mineral(树形DP)
Problem DescriptionHumans have discovered a kind of new metal mineral on Mars which are distributed in point‐like with paths connecting each of them which formed a tree. Now Humans launches k robots原创 2013-08-11 16:17:39 · 2283 阅读 · 0 评论 -
POJ1155:TELE(树形DP)
DescriptionA TV-network plans to broadcast an important football match. Their network of transmitters and users can be represented as a tree. The root of the tree is a transmitter that emits the foo原创 2013-08-11 23:55:35 · 3740 阅读 · 2 评论