![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DP
know_heng
步步皆题
展开
-
1519. Formula 1 (插头DP,求哈密顿回路)
1519. Formula 1Time limit: 1.0 secondMemory limit: 64 MBBackgroundRegardless of the fact, that Vologda could not get rights to hold the Winter Olympic games of 20**, it is well-known,原创 2017-10-17 11:18:46 · 440 阅读 · 0 评论 -
SHU 422 风力观测 (线段树,区间更新,区间询问历史最大值)
描述小Y正在观测y地区的风力情况,他在一条直线上依此设定了n个观测点,并观测与直线垂直方向的风力值,风力有时是正向的也有时是反向的,规定正向时的风力值为正数,他发现每次风力值的变化都可以表示为观测点上一条线段[L,R]上的同时增强或者减弱。小Y希望能够实时统计这些观测点的数据,并且实时分析这些观测点在历史中到达的风力最大绝对值,但是他无法同时对大量的观测点进行分析, 更重要的是他记不住原创 2017-07-10 18:17:48 · 709 阅读 · 0 评论 -
POJ 1160 Post Office (区间DP+重心)
Post OfficeTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19868 Accepted: 10676DescriptionThere is a straight highway with villages alongside the hig原创 2017-06-09 11:43:34 · 291 阅读 · 0 评论 -
SHU OJ 420 购买装备(假装背包,其实贪心)
描述最近盛大的一款游戏传奇世界极其火爆。游戏玩家John,想购买游戏中的装备。已知游戏的商店里有n件装备,第i件装备具有属性值ai,购买需要花费bi个金币。John想去购买这些装备,但是账号中只有m个金币,John是个很贪婪的家伙,他想购买尽可能多的装备。并且在保证购买到最多件装备的情况下,他还想让他所购买的装备当中拥有最小属性值的装备的属性值尽可能大。输入输入原创 2017-07-10 17:27:43 · 487 阅读 · 0 评论 -
hihoCoder 交错和 (数位DP)
#1033 : 交错和时间限制:10000ms单点时限:1000ms内存限制:256MB描述给定一个数 x,设它十进制展从高位到低位上的数位依次是 a0, a1, ..., an - 1,定义交错和函数:f(x) = a0 - a1 + a2 - ... + ( - 1)n - 1an - 1例如:f(3214567) =原创 2017-05-20 11:11:14 · 409 阅读 · 0 评论 -
POJ 1157(DP ,数塔问题)
LITTLE SHOP OF FLOWERSTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 21394 Accepted: 9895DescriptionYou want to arrange the window of your flower sho原创 2017-04-26 18:58:09 · 319 阅读 · 0 评论 -
HDU 5542 (DP+树状数组优化)
The Battle of ChibiTime Limit: 6000/4000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1598 Accepted Submission(s): 565Problem DescriptionCao Cao原创 2017-04-26 17:40:28 · 454 阅读 · 0 评论 -
ZOJ 3949 (树形DP)
Edge to the RootTime Limit: 1000MS Memory Limit: 131072KB 64bit IO Format: %lld & %lluSubmit StatusDescriptionGiven a tree with n vertices, we want to add an原创 2017-04-25 15:20:14 · 694 阅读 · 0 评论 -
HDU 5543 (DP)
The story happened long long ago. One day, Cao Cao made a special order called "Chicken Rib" to his army. No one got his point and all became very panic. However, Cao Cao himself felt very proud of hi原创 2017-04-25 14:15:16 · 242 阅读 · 0 评论 -
POJ 3254 (基础 状态压缩 DP )
Corn FieldsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14837 Accepted: 7768DescriptionFarmer John has purchased a lush new rectangular pasture com原创 2017-05-05 17:16:29 · 400 阅读 · 0 评论 -
FOJ 2172 (DP+水数据+水题解 )
Description 大师兄在取经途中迷上了ACM-ICPC,稍不留神,师傅就被妖怪抓走了。 大师兄并不着急去救师傅,在虐这道简单题: 有两个字符串A和B,每一次可以选择以下操作中的一种,只对字符串A进行操作,用最少的操作使得字符串A与字符串B相等:在字符串A中插入一个字符;在字符串A中删除一个字符;将字符串A复制,得到字符串A的一个拷贝原创 2017-04-21 19:28:10 · 276 阅读 · 0 评论 -
HDU 1693 Eat the Trees(轮廓线DP)
Problem DescriptionMost of us know that in the game called DotA(Defense of the Ancient), Pudge is a strong hero in the first period of the game. When the game goes to end however, Pudge is not a s原创 2017-07-21 09:48:16 · 319 阅读 · 0 评论 -
HDU 3001 Travelling (状态压缩DP +TSP问题)
Problem DescriptionAfter coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does no原创 2017-07-18 09:51:18 · 271 阅读 · 0 评论 -
HDU 2476 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 ch原创 2017-07-09 10:01:26 · 248 阅读 · 0 评论 -
HDU 6035 Colorful Tree (树形DP,dfs)
Problem DescriptionThere is a tree with n nodes, each of which has a type of color represented by an integer, where the color of node i is ci.The path between each two different nodes is uni原创 2017-07-28 14:20:16 · 228 阅读 · 0 评论 -
K - 炮 bzoj- 4806 (DP)
众所周知,双炮叠叠将是中国象棋中很厉害的一招必杀技。炮吃子时必须隔一个棋子跳吃,即俗称"炮打隔子"。 炮跟炮显然不能在一起打起来,于是rly一天借来了许多许多的炮在棋盘上摆了起来……他想知道,在N×M的矩形方格中摆若干炮(可以不摆)使其互不吃到的情况下方案数有几种。棋子都是相同的。Input一行,两个正整数N和M。NOutput一行,输出方案数mod原创 2017-08-04 08:38:49 · 763 阅读 · 0 评论 -
hdu 4960 Another OCD Patient(DP)
Problem DescriptionXiaoji is an OCD (obsessive-compulsive disorder) patient. This morning, his children played with plasticene. They broke the plasticene into N pieces, and put them in a line. Eac原创 2017-08-03 21:29:51 · 254 阅读 · 0 评论 -
hdu 5110 (DP+分块)
Problem DescriptionAlexandra and her little brother are playing a game called "Clash of Submarines" (COS, for short). In this game, one can build so many(about 100,000) submarines, and detect and原创 2017-08-09 18:49:24 · 272 阅读 · 0 评论 -
HDU 2167 Pebbles(轮廓线,状态压缩DP)
Problem DescriptionYou're given an unlimited number of pebbles to distribute across an N x N game board (N drawn from [3, 15]), where each square on the board contains some positive point value be原创 2017-07-24 08:59:00 · 462 阅读 · 0 评论 -
POJ 2411 Mondriaan's Dream(插头DP,轮廓线)
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原创 2017-07-19 09:11:58 · 249 阅读 · 0 评论 -
HDU 1565 方格取数(1)(插头DP||状态压缩)
Problem Description给你一个n*n的格子的棋盘,每个格子里面有一个非负数。从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取的数所在的2个格子不能相邻,并且取出的数的和最大。 Input包括多个测试实例,每个测试实例包括一个整数n 和n*n个非负数(n Output对于每个测试实例,输出可能取得的原创 2017-07-22 10:01:22 · 315 阅读 · 0 评论 -
HDU 5230 ZCC loves hacking(DP)
Problem DescriptionNow, a Codefires round is coming to end. ZCC has got C(0≤C≤106) points by solving all problems. He is amazed that all other contestants in his room have also solved the hardes原创 2017-07-10 10:57:59 · 250 阅读 · 0 评论 -
ZOJ 3471Most Powerful(状态压缩DP)
Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms collide, one of them disappears and a lot of powe原创 2017-07-18 10:33:22 · 207 阅读 · 0 评论 -
POJ 3311 Hie with the Pie (状态压缩DP ,TSP问题)
DescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deliveries原创 2017-07-09 14:58:06 · 338 阅读 · 0 评论 -
poj 1159 (LCS)
PalindromeTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 62709 Accepted: 21852DescriptionA palindrome is a symmetrical string, that is, a string read原创 2017-05-02 18:32:48 · 178 阅读 · 0 评论 -
POJ 1185 炮兵阵地 (状态压缩DP)
炮兵阵地Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 27600 Accepted: 10693Description司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用"H" 表示),原创 2017-05-10 21:37:38 · 209 阅读 · 0 评论 -
POJ 1143 (记忆化搜索,状态压缩,博弈论记忆化搜索实现)
Number GameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3760 Accepted: 1557DescriptionChristine and Matt are playing an exciting game they just inv原创 2017-04-19 19:59:37 · 629 阅读 · 0 评论 -
石子合并(DP+ 四边形不等式优化)
此类问题如 石子合并问题 和 玲珑OJ 1066 buy candy 区间DP的典型例题, 状态转移是 dp【i】【j】=min(dp【i】【k】+dp【k+1】【j】+w【i,j】){ i有一种情况可以优化为O(N^2)的时间复杂度,(1)当函数w[i,j]满足w[i,j]+w[i',j'](2)当函数w[i,j]满足w[i’,j]≤w[i,原创 2016-12-18 16:09:34 · 804 阅读 · 0 评论 -
hdu 2126 (背包问题之求方案数)
Buy the souvenirsTime Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2156 Accepted Submission(s): 820Problem DescriptionWhen the原创 2016-12-14 10:36:55 · 1177 阅读 · 0 评论 -
HDU 5965 扫雷(递推)
扫雷Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 718 Accepted Submission(s): 169Problem Description扫雷游戏是晨晨和小璐特别喜欢的智力游戏,她俩最近沉原创 2016-11-09 11:00:06 · 827 阅读 · 0 评论 -
POJ 1050 To the Max(DP)
To the MaxTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 47559 Accepted: 25161DescriptionGiven a two-dimensional array of positive and negative integer原创 2016-11-26 21:33:27 · 196 阅读 · 0 评论 -
HDU 2639 (背包第K优解)
Bone Collector IITime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4317 Accepted Submission(s): 2249Problem DescriptionThe titl原创 2016-11-19 09:25:01 · 478 阅读 · 0 评论 -
POJ 1037 (DP)
A decorative fenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7423 Accepted: 2805DescriptionRichard just finished building his new house. Now the on原创 2016-11-19 17:29:30 · 293 阅读 · 0 评论 -
poj 1088 (记忆化搜索)
滑雪Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 93547 Accepted: 35393DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等原创 2016-12-02 15:24:35 · 188 阅读 · 0 评论 -
poj 1080 (DP)
Human Gene FunctionsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19224 Accepted: 10706DescriptionIt is well known that a human gene can be considered原创 2016-12-02 14:47:36 · 179 阅读 · 0 评论 -
POJ 1036 Gangsters(DP)
GangstersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 12559 Accepted: 3556DescriptionN gangsters are going to a restaurant. The i-th gangster comes a原创 2016-11-15 19:03:25 · 281 阅读 · 0 评论 -
poj 1042 (DP)
Gone FishingTime Limit: 2000MS Memory Limit: 32768KTotal Submissions: 33972 Accepted: 10458DescriptionJohn is going on a fishing trip. He has h hours available (1原创 2016-11-30 20:02:16 · 292 阅读 · 0 评论 -
lloj 1074(区间DP)
题目链接题意:N个数,每次取一个数numi,它的价值等于数列中左边的数 * numi * 右边的数,取完这个数之后,数列重新排列,重复取值,直到取完为止,问取得价值最大和。这道题和取石子问题很像,不同的是取石子问题是合并了一堆,而这里是取走一个值。状态dp【i】【j】表示区间i~j可以取得的最大值,当然第i个数和第j个数是没有取走的。状态转移方程 dp【i】【j】=max原创 2016-12-24 16:04:13 · 480 阅读 · 0 评论 -
玲珑OJ 1070 (区间DP)
1070 - Generate StringTime Limit:1s Memory Limit:1024MByteSubmissions:106Solved:28DESCRIPTIONMr. Van wants to generate a sequence of characters starting from an empty strin原创 2016-12-18 18:19:48 · 243 阅读 · 0 评论 -
POJ 1038(状态压缩DP)
Bugs Integrated, Inc.Time Limit: 15000MS Memory Limit: 30000KTotal Submissions: 10080 Accepted: 3884Case Time Limit: 5000MSDescriptionBugs Integrated, Inc.原创 2016-11-24 18:52:41 · 442 阅读 · 0 评论