
动态规划
文章平均质量分 84
Wiking__acm
这个作者很懒,什么都没留下…
展开
-
uva 10123 No Tipping (状压dp)
Problem A - No TippingAs Archimedes famously observed, if you put an object on a lever arm, it will exert a twisting force around the lever's fulcrum. This twisting is called torque and is equal to原创 2014-09-01 21:53:16 · 861 阅读 · 0 评论 -
uva 11908 - Skyscraper (dp)
JSkyscraperThe Build n' Profit construction company is about to build its tallest building. It will be huge, the tallest building in the world by a wide margin. It will house hundred原创 2014-05-08 22:49:27 · 1367 阅读 · 0 评论 -
uva 12002 Happy Birthday (dp)
Happy Birthday Today it's February 13th. It's a very special day: Miguel's birthday! Like every year, he's organised a big celebration for all his friends. He prepared a succulent dinner a原创 2014-05-07 12:51:29 · 790 阅读 · 0 评论 -
uva 10051 Tower of Cubes(dp)
In this problem you are given N colorful cubes each having a distinct weight. Each face of a cube is colored with one color. Your job is to build a tower using the cubes you have subject to the foll原创 2014-05-05 22:34:02 · 1257 阅读 · 0 评论 -
uva 10154 Weights and Measures(dp)
Problem F: Weights and MeasuresI know, up on top you are seeing great sights, But down at the bottom, we, too, should have rights. We turtles can't stand it. Our shells will all crack! Besides原创 2014-05-05 19:13:24 · 775 阅读 · 0 评论 -
uva 12034 Race(dp)
Race Disky and Sooma, two of the biggest mega minds of Bangladesh went to a far country. They ate, coded and wandered around, even in their holidays. They passed several months in this way原创 2014-05-06 10:43:37 · 1247 阅读 · 0 评论 -
CF Trainings Season 1 Episode 6 I (dp)
Problem I. DNAInput le: stdinOutput le: stdoutTime limit: 2 secondsMemory limit: 256 megabytesBiologists have discovered a strange DNA molecule, best described as a sequence of N character原创 2013-10-21 13:56:16 · 1315 阅读 · 0 评论 -
hdu 1300 (dp)
PearlsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1225 Accepted Submission(s): 550Problem DescriptionIn Pearlania everybo原创 2013-10-21 16:25:29 · 945 阅读 · 0 评论 -
hdu 1677 (dp)
Nested DollsTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2153 Accepted Submission(s): 631Problem DescriptionDilworth is th原创 2013-10-20 09:14:50 · 950 阅读 · 0 评论 -
hdu 4001(dp)
To Miss Our Children TimeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 2261 Accepted Submission(s): 312Problem Description原创 2013-09-18 19:15:54 · 1006 阅读 · 0 评论 -
做过的dp汇总
把做过的dp题链接汇总到这里,以后做过的会陆续添加进来。http://blog.csdn.net/wiking__acm/article/details/7864305线性模型http://blog.csdn.net/wiking__acm/article/details/8267820把一个串划分成个数最少的回文串线性模型http://blog.csdn.原创 2013-09-18 19:44:41 · 1397 阅读 · 3 评论 -
hdu 2437 (记忆化搜索)
JerboasTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1256 Accepted Submission(s): 329Problem Description Jerboas are s原创 2013-10-03 20:26:42 · 790 阅读 · 0 评论 -
uva 10534 - Wavio Sequence (dp)
Problem DWavio Sequence Input: Standard InputOutput: Standard Output Time Limit: 2 SecondsWavio is a sequence of integers. It has some interesting properties. · Wavio is of odd length i.原创 2012-12-07 18:07:11 · 2265 阅读 · 0 评论 -
Poj 2184 (dp)
Cow ExhibitionTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7795 Accepted: 2852Description"Fat and docile, big and dumb, they look so stupid, they are原创 2013-08-18 14:31:04 · 1152 阅读 · 0 评论 -
uva 10029 - Edit Step Ladders(巧妙构图 + Dag最长路)
Problem C: Edit Step LaddersAn edit step is a transformation from one word x to another word y such that x and y are words in the dictionary, and x can be transformed to y by adding, delet原创 2014-04-23 18:55:32 · 2114 阅读 · 0 评论 -
uva 11782 - Optimal Cut (树形dp)
Optimal Cut A cut of a binary tree is a set of tree nodes such as for each possible path from the root node to any leaf node, just one node in the cut belongs to the path. In a weighted bi原创 2014-05-19 18:27:48 · 1017 阅读 · 0 评论 -
uva 10296 - Jogging Trails (中国邮路问题 状压dp)
Problem B: Jogging TrailsGord is training for a marathon. Behind his house is a park with a large network of jogging trails connecting water stations. Gord wants to find the shortest jogging route t原创 2014-09-01 18:38:00 · 1266 阅读 · 0 评论 -
uva 10163 Storage Keepers (dp)
Background Randy Company has N (11. Each keeper has a number Pi (12. All storages are the same as each other.3. A storage can only be lookd after by one keeper. But a keepe原创 2014-08-23 15:12:16 · 796 阅读 · 0 评论 -
uva 10163 Phylogenetic Trees Inherited (状态压缩+贪心)
Problem D: Phylogenetic Trees InheritedAmong other things, Computational Molecular Biology deals with processing genetic sequences. Considering the evolutionary relationship of two sequences, we c原创 2014-08-23 17:20:30 · 942 阅读 · 0 评论 -
uva 10239 The Book-shelver's Problem (dp)
Problem DThe Book-shelver’s ProblemInput: standard inputOutput: standard outputTime Limit: 5 secondsMemory Limit: 32 MB You are given a collection of books, which must be shelved in原创 2014-08-23 23:54:57 · 872 阅读 · 0 评论 -
uva 10128 Queue (dp)
QueueThere is a queue with N people. Every person has a different heigth. We can see P people, when we are looking from the beginning, and R people, when we are looking from the end.It�s because the原创 2014-08-22 22:37:27 · 1138 阅读 · 0 评论 -
uva 10599(dp)
Problem KRobots(II)Time Limit1 Second Your company provides robots that can be used to pick up litter from fields after sporting events and concerts. Before robots ar原创 2014-08-09 15:33:00 · 796 阅读 · 0 评论 -
uva 10593 Kites(dp)
Problem EKitesTime Limit4 Seconds The season of flying kites is well ahead. So what? Let us make an inventory for kites. We are given a square shaped sheet of paper.原创 2014-08-10 22:01:03 · 828 阅读 · 0 评论 -
uva 10304 Optimal Binary Search Tree(dp)
Optimal Binary Search TreeInput: standard inputOutput: standard outputTime Limit: 30 secondsMemory Limit: 32 MBGiven a set S = (e1, e2, ..., en) of n distinct elements such that e1 2 n and c原创 2014-08-23 12:02:33 · 804 阅读 · 0 评论 -
uva 10529 - Dumb Bones(概率dp)
Problem D: Dumb BonesYou are trying to set up a straight line of dominos, standing on end, to be pushed over later for your entertainment. (Sure, it seems pointless to set something up only to knock原创 2014-08-06 23:34:27 · 1180 阅读 · 0 评论 -
CF 259div2 D (状态压缩dp)
B. Little Pony and Harmony Chesttime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPrincess Twilight went to原创 2014-08-03 13:03:28 · 890 阅读 · 0 评论 -
uva 10626 - Buying Coke(记忆化搜索)
Problem DBuying Coke Input: Standard InputOutput: Standard OutputTime Limit: 2 SecondsI often buy Coca-Cola from the vending machine at work. Usually I buy several cokes at once, since my wo原创 2014-07-27 17:34:30 · 1137 阅读 · 0 评论 -
uva 11264 - Coin Collector(dp or 贪心)
Problem ECoin CollectorInput: Standard InputOutput: Standard Output Our dear Sultan is visiting a country where there are n different types of coin. He wants to collect as many different typ原创 2014-05-22 10:03:52 · 1396 阅读 · 0 评论 -
uva 11307 - Alternative Arborescence (树形dp)
Problem AALTERNATIVE ARBORECSENCEGiven a graph, we define "proper coloring" as coloring of the graph nodes in such way that no two adjacent nodes have the same color. If we map each color to a原创 2014-05-19 21:29:57 · 1140 阅读 · 0 评论 -
Poj 1065 (dp)
Wooden SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 16517 Accepted: 6868DescriptionThere is a pile of n wooden sticks. The length and weight of原创 2013-08-18 21:38:26 · 1453 阅读 · 5 评论 -
Poj 2392(dp)
Space ElevatorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7192 Accepted: 3370DescriptionThe cows are going to space! They plan to achieve orbit by b原创 2013-08-18 16:22:12 · 1324 阅读 · 0 评论 -
Poj 3280(dp)
Cheapest PalindromeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 4648 Accepted: 2263DescriptionKeeping track of all the cows can be a tricky task so F原创 2013-08-17 23:29:00 · 1944 阅读 · 1 评论 -
hdu String painter(dp)
String painterTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1075 Accepted Submission(s): 420Problem DescriptionThere are two string原创 2012-12-21 11:03:45 · 3210 阅读 · 2 评论 -
uva 10564 - Paths through the Hourglass(dp)
题目链接http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1505Problem FPaths through the HourglassInput: Standard InputOutput: Standard OutputTime原创 2012-12-20 17:40:41 · 1205 阅读 · 0 评论 -
poj 2948 -- Martian Mining(dp)
Martian MiningTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 2053Accepted: 1236DescriptionThe NASA Space Center, Houston, is less than 200 miles from San原创 2012-12-12 21:04:29 · 1141 阅读 · 0 评论 -
uva 11552 - Fewest Flops(dp)
题目链接http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2547Problem F FEWEST FLOPSA common way to uniquely encode a string is by replacing its co原创 2012-12-12 13:59:10 · 1593 阅读 · 0 评论 -
hdu Parade(单调队列优化 dp)
ParadeTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 504 Accepted Submission(s): 209Problem DescriptionPanagola, The Lord of city F原创 2012-12-22 22:54:29 · 1428 阅读 · 0 评论 -
uva 10827 - Maximum sum on a torus(dp)
题目链接http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1768Problem HMaximum sum on a torusInput: Standard InputOutput: Standard OutputA grid that原创 2012-11-28 21:57:22 · 1308 阅读 · 0 评论 -
uva 11584 - Partitioning by Palindromes (dp)
题目链接http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2631We say a sequence of characters is a palindrome if it is the same written forwards and backwa原创 2012-12-07 09:05:16 · 1834 阅读 · 0 评论 -
xtu1148 dp
#include #include struct Node{ int s,t,v; }test[100005]; using namespace std; bool cmp(Node a,Node b){ return a.t <= b.t; } __int64 dp[100005]; int max(int a,int b){ return a > b ?原创 2012-05-25 12:07:02 · 813 阅读 · 0 评论