动态规划
文章平均质量分 82
say_c_box
小白不能不努力~
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU1024 ——Max Sum Plus Plus(动态规划)
Max Sum Plus PlusTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 28869 Accepted Submission(s): 10125Problem DescriptionNow I原创 2017-05-28 16:01:40 · 468 阅读 · 0 评论 -
HDU4800——Josephina and RPG(概率dp)
Josephina and RPGTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1538 Accepted Submission(s): 467Special JudgeProblem Description原创 2016-10-15 11:06:29 · 430 阅读 · 0 评论 -
HDU3555——Bomb(数位dp入门)
BombTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 15805 Accepted Submission(s): 5761Problem DescriptionThe counter-terrori原创 2016-10-02 18:36:35 · 508 阅读 · 1 评论 -
HDU2089——不要62(数位dp入门)
不要62Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 35612 Accepted Submission(s): 12972Problem Description杭州人称那些傻乎乎粘嗒嗒的人为62(音原创 2016-10-03 17:50:34 · 430 阅读 · 0 评论 -
Codeforces Round #383 (Div. 2)全部题解 (A,B,C,D,E)
A. Arpa’s hard exam and Mehrdad’s naive cheattime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere exists a原创 2016-12-07 19:09:15 · 2024 阅读 · 0 评论 -
Gym - 101116K ——Mixing Bowls(树形dp)
原题:https://odzkskevi.qnssl.com/efe310c5868f7c1881a7cec2c6b3e9cc?v=1487513501You are following a recipe to create your lunch.The recipe is a mixture made by combining ingredients togetherin a bow原创 2017-02-27 21:26:30 · 397 阅读 · 0 评论 -
POJ1037————A decorative fence(动态规划)
A decorative fenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7545 Accepted: 2869DescriptionRichard just finished building his new house. Now the原创 2017-03-04 10:43:29 · 1726 阅读 · 0 评论 -
UESTC878————温泉旅店(动态规划)
温泉旅店Time Limit: 3000/1000MS (Java/Others) Memory Limit: 262143/262143KB (Java/Others)Submit Status天空飘下一朵一朵的雪花,这是一片纯白的世界。在天空之下的温泉旅店里,雪菜已醉倒在一旁,冬马与春希看了看说着梦话的雪菜,决定找一点玩的来度过这愉快的晚原创 2017-02-26 14:15:16 · 746 阅读 · 0 评论 -
POJ1692————Crossed Matchings(动态规划)
There are two rows of positive integer numbers. We can draw one line segment between any two equal numbers, with values r, if one of them is located in the first row and the other one is located in th原创 2017-02-26 14:59:03 · 535 阅读 · 0 评论 -
codeforces621E————Wet Shark and Blocks(动态规划,矩阵快速幂)
E. Wet Shark and Blockstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are b blocks of digits. Each原创 2017-02-26 21:05:36 · 506 阅读 · 0 评论 -
HDU4345————Permutation(置换群,dp)
PermutationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 910 Accepted Submission(s): 536Problem DescriptionThere is an arra原创 2017-03-23 11:09:26 · 426 阅读 · 0 评论 -
codeforces 788A——Functions again(动态规划)
A. Functions againtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSomething happened in Uzhlyandia again...原创 2017-03-30 20:12:05 · 1158 阅读 · 0 评论 -
UVALive 3942 - Remember the Word(DP,字典树)
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1943白书P209// test.cpp : 定义控制台应用程序的入口点。//#define _CRT_SECURE_NO_WARNINGS#include原创 2017-03-14 21:53:54 · 444 阅读 · 0 评论 -
codeforce Gym100269F——Flight Boarding Optimization(动态规划)
题目传送门:http://codeforces.com/gym/100269/attachments/download/1978/20132014-acmicpc-neerc-nothern-subregional-contest-en.pdfdp[i][j]表示i为最后一个分段的结尾,一共分了j端。详细的解释可以看这篇博客,想到预处理正序对就很简单了。http://blog.原创 2017-05-10 19:59:18 · 681 阅读 · 0 评论 -
codeforcodeforces 808E——Selling Souvenirs(动态规划)官方题解详解
E. Selling Souvenirstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter several latest reforms many tour原创 2017-05-16 08:46:52 · 1999 阅读 · 1 评论 -
codeforces811C——Vladik and Memorable Trip(动态规划)
C. Vladik and Memorable Triptime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVladik often travels by trains原创 2017-05-28 13:00:50 · 1933 阅读 · 0 评论 -
HDU5543——Pick The Sticks(动态规划)
Pick The SticksTime Limit: 15000/10000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 1336 Accepted Submission(s): 443Problem DescriptionThe story原创 2016-10-14 16:39:21 · 488 阅读 · 0 评论 -
POJ1458————Common Subsequence
Common SubsequenceTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 52488 Accepted: 21709DescriptionA subsequence of a given sequence is the given seque原创 2017-05-28 23:05:31 · 437 阅读 · 0 评论 -
POJ1661——Help Jimmy(动态规划)
Help JimmyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11553 Accepted: 3790Description"Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低原创 2017-05-28 23:16:20 · 532 阅读 · 0 评论 -
codefoces 812B——Sagheer, the Hausmeister(动态规划)
B. Sagheer, the Hausmeistertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSome people leave the lights at原创 2017-06-02 10:20:43 · 766 阅读 · 0 评论 -
最优二叉查找树详解(算法导论学习笔记)
代码均未经过严格测试,仅供参考最优二叉查找树动态规划原理动态规划与分治法相似,都是通过组合子问题的解来求解原问题。动态规划通常是用来求解最优化问题(optimization problem).这类问题可以有很多个可行解,每个解都有一个值,我们希望寻找最优值(最大值或者最小值)的解。我们称这样的解为问题的一个最优解(oneoptimization solution)而不是最优解(theoptimiz原创 2017-06-08 09:04:14 · 20740 阅读 · 1 评论 -
HDU1069——Monkey and Banana(动态规划)
Monkey and BananaTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15100 Accepted Submission(s): 7997Problem DescriptionA group原创 2017-07-02 21:42:29 · 411 阅读 · 0 评论 -
HDU1074——Doing Homework(状态压缩dp)
Doing HomeworkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9323 Accepted Submission(s): 4405Problem DescriptionIgnatius ha原创 2017-07-02 21:45:00 · 482 阅读 · 0 评论 -
codeforces Gym - 101190F——Foreign Postcards(动态规划)
http://codeforces.com/gym/101190/attachments题目大意:有n张卡片,每一张卡片有一个初始摆放方式,w代表错误方式,c代表正确方式。每次随意选出最上方的k张卡片,观察第一张,如果第一张错误摆放,则将这k张全部翻转,这k张就不再管了,知道卡片堆为空为止。问最后错误摆放的牌的个数的期望。 题解:我们从后往前考虑,dp[i]表示剩余卡片为i-n的情况下,考虑怎么转原创 2017-07-23 22:31:29 · 1040 阅读 · 0 评论 -
HDU4917 Permutation(状态压缩dp,图论)
PermutationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 896 Accepted Submission(s): 281Problem Descriptionbobo has a per原创 2017-07-24 09:23:19 · 716 阅读 · 0 评论 -
E. Karen and Supermarket(树形dp)
E. Karen and Supermarkettime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputOn the way home, Karen decided to原创 2017-07-25 10:30:32 · 682 阅读 · 0 评论 -
HDU6035 Colorful Tree(树形dp)
Colorful TreeTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1152 Accepted Submission(s): 463Problem DescriptionThere is a原创 2017-07-26 17:21:41 · 1828 阅读 · 0 评论 -
HDU6078 Wavel Sequence(动态规划)
Wavel SequenceTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 728 Accepted Submission(s): 377Problem DescriptionHave you ev原创 2017-08-28 19:28:22 · 502 阅读 · 0 评论 -
HDU5492 Find a path (动态规划)
Find a pathTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1866 Accepted Submission(s): 809Problem DescriptionFrog fell into原创 2017-08-29 19:16:46 · 359 阅读 · 0 评论 -
HDU3401 Trade (动态规划+单调队列)
/*知道之后n天的股票买卖价格(api,bpi),以及每天股票买卖数量上限(asi,bsi),问他最多能赚多少钱。开始时有无限本金,要求任两次交易需要间隔W天以上,即第i天交易,第i+w+1天才能再交易。同时他任意时刻最多只能拥有maxp的股票,容易写出DP方程 dp[i][j]=max{dp[i-1][j],max{dp[r][k]-APi[i]*(j-k)}(0j)} 分别是第i天不交易原创 2017-09-07 21:13:25 · 569 阅读 · 0 评论 -
POJ 1821--Fence(单调队列优化dp,总结一下)
FenceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 5185 Accepted: 1643DescriptionA team of k (1 <= K <= 100) workers should paint a fence which contai原创 2017-10-10 19:53:13 · 724 阅读 · 0 评论 -
关于集合整数表示的一些技巧以及状态压缩dp入门(POJ3254)
当元素比较少的时候,并且和集合状态有关的问题是,就可以考虑用一个二进制的整数来表示集合。整数的每一位上,若为0则表示对应的元素不选取,若为1则表示对应的元素选取。以此为基础可以进行一些简单的集合运算。空集:0 只含有第i个元素的集合:1含有从0开始的n个元素的集合: 1判断第i个元素是否属于集合S:if(S>>i&1)向集合中加入第i个元素:S|(1向集合中删原创 2016-08-02 15:43:46 · 572 阅读 · 0 评论 -
HDU2577——How to Type 动态规划
题目如下: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 i原创 2016-03-16 21:58:57 · 637 阅读 · 0 评论 -
CodeForces 698A——Vacations(动态规划)
D - VacationsTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionVasya has n days of vacations! So he decided to improve his IT s原创 2016-07-23 12:59:34 · 1526 阅读 · 0 评论 -
POJ 2342 ——Anniversary party(树形dp基础)
Anniversary partyTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionThere is going to be a party to celebrate the 80-th Anniversa原创 2016-07-23 13:13:36 · 346 阅读 · 0 评论 -
Bribe the Prisoners——GCJ 2009 Round1C C(区间dp)
题目:P个并排的牢房(1,2,3....P)。每个牢房一个囚犯。现在要释放其中的Q个囚犯。每释放一个囚犯,就得向左给每一个相邻囚犯一枚金币,直到遇到空牢房。向右也是如此。问以什么样的顺序释放所花费的金币最少?#include #include #include #include #include #include #include #include #include usin原创 2016-07-17 10:17:42 · 606 阅读 · 0 评论 -
POJ2411——Mondriaan's Dream(轮廓线dp入门)
Mondriaan's DreamTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 15207Accepted: 8771DescriptionSquares and rectangles fascinated the famous Dutch pai原创 2016-08-03 20:12:01 · 1103 阅读 · 0 评论 -
10635 - Prince and Princess(最长公共子序列优化,动态规划)
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1576题意:就是求两个序列的最长公共子序列思路:因为数据量是10^5的,一般的n^2的算法会TML。所以得优化,就是把a中出现的数,在b中出现过的对应的位置记录下来,然后用nlgn的原创 2016-08-03 20:29:55 · 639 阅读 · 0 评论 -
HDU5745(2016多校第二场)——La Vie en rose(bitset,动态规划)
La Vie en roseTime Limit: 7000/3500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2329 Accepted Submission(s): 706Problem DescriptionProfessor Zh原创 2016-08-15 20:17:57 · 754 阅读 · 0 评论 -
POJ2955——Brackets(区间dp)
BracketsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6335 Accepted: 3388DescriptionWe give the following inductive definition of a “regular brack原创 2016-08-15 23:27:05 · 377 阅读 · 0 评论
分享