![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM_动态规划
文章平均质量分 82
77458
手敲仙盘键,目视星空棋,灵控比特力,逍遥虚空界。
展开
-
CCF压缩编码和玲珑杯1066 - Buy Candy(平行四边形优化)
玲珑杯1066 - Buy Candy(传送门) 题解就是个简单的石子合并,一般的石子合并问题我们用O(n3)O(n^3)的复杂度解决,通过平行四边形优化可以达到降低一维,实现O(n2)O(n^2)的复杂度,平行四边形优化可以解决满足如下条件的问题: dp[i][j] = min{dp[i][k]+dp[k+1][j]+w[i][j]} 我们用S[i][j]保存当前让dp[i][j]最优的原创 2016-12-22 14:17:25 · 1315 阅读 · 0 评论 -
POJ- 1579 Function Run Fun
POJ - 1579Function Run FunTime Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionWe all love recursion! Don't we?原创 2015-06-20 10:29:31 · 779 阅读 · 0 评论 -
HDU 4597 H - Play Game
H - Play GameTime Limit:1000MS Memory Limit:65535KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 4597DescriptionAlice and Bob are playing a game. There are two原创 2015-06-05 21:00:37 · 913 阅读 · 0 评论 -
免费馅饼
题目链接免费馅饼Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 28346 Accepted Submission(s): 9670Problem Description都说天上不会掉馅饼,原创 2015-03-06 18:19:08 · 704 阅读 · 2 评论 -
HDU - 1677Nested Dolls最长上升子序列变式
HDU - 1677Nested DollsTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionDilworth is the world’s most prominent co原创 2015-08-05 11:19:54 · 1347 阅读 · 0 评论 -
HDU - 4545魔法串最长公共子序列
HDU - 4545魔法串Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription 小明和他的好朋友小西在玩一个新的游戏,由小西给出一个由小写字母构成的字符串,小明给出另一个比小西原创 2015-08-05 08:54:19 · 594 阅读 · 0 评论 -
POJ - 1463Strategic game入门树形DP
POJ - 1463Strategic gameTime Limit: 2000MS Memory Limit: 10000KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionBob enjoys playing computer games, es原创 2015-08-04 23:08:54 · 735 阅读 · 0 评论 -
vijos - P1286座位安排 (DP状态压缩 + 组合数 + python)
P1286座位安排Accepted标签:[显示标签]背景快要期中考试了!老师需要hzy帮他排考试的座位。。。描述考场里的座位恰好有n行m列,并且恰好有n*m位考生在这个考场里面考试,也就是说,所有的座位上都有考生。hzy根据学校记载,有k位考生可能作弊,因此hzy不能让他们之中的任何两个人做原创 2015-08-16 22:25:43 · 1269 阅读 · 0 评论 -
HDU 3469 Catching the Thief (博弈 + DP递推)
Catching the ThiefTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 653 Accepted Submission(s): 359Problem DescriptionIn the Qi原创 2015-08-14 16:26:37 · 1135 阅读 · 0 评论 -
HDU 1028 Ignatius and the Princess III(母函数 或者 整数划分的DP动态规划)
Ignatius and the Princess IIITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15710 Accepted Submission(s): 11080Problem Descripti原创 2015-08-14 16:35:10 · 902 阅读 · 0 评论 -
Big Event in HDU
I - Big Event in HDUTime Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionNowadays, we all know that Computer College is the biggest d原创 2015-07-07 15:20:24 · 866 阅读 · 0 评论 -
HDU - 4512吉哥系列故事――完美队形I最大上升公共子序列
HDU - 4512吉哥系列故事――完美队形ITime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription 吉哥这几天对队形比较感兴趣。 有一天,有n个人按顺序站在他的面前,他原创 2015-08-05 14:04:22 · 882 阅读 · 0 评论 -
POJ - 3411 Paid Roads (状态压缩DP)
Paid Roads Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6750 Accepted: 2505DescriptionA network of m roads connects N cities (numbered from 1 to N). There may be more than on原创 2016-08-22 10:04:17 · 768 阅读 · 0 评论 -
POJ - 2836 Rectangular Covering(状态压缩DP)
Rectangular CoveringTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2297 Accepted: 647Descriptionn points are given on the Cartesian plane. Now you have原创 2016-08-20 23:28:40 · 538 阅读 · 0 评论 -
POJ - 3254 Corn Fields (状态压缩 + DFS)
Corn FieldsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 13395 Accepted: 7032DescriptionFarmer John has purchased a lush new rectangular pasture compo原创 2016-08-20 15:54:20 · 663 阅读 · 0 评论 -
POJ - 2441 Arrange the Bulls (状态压缩DP)
Arrange the BullsTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 4458 Accepted: 1695DescriptionFarmer Johnson's Bulls love playing basketball very much.原创 2016-08-18 22:26:35 · 685 阅读 · 0 评论 -
HDU 5763 Another Meaning 多校赛 (DP + KMP)
Another MeaningTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1111 Accepted Submission(s): 518Problem DescriptionAs is known原创 2016-08-01 21:08:50 · 545 阅读 · 0 评论 -
Codeforces Round #363 (Div. 2) C. Vacations(DP)
C. Vacationstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has n days of vacations! So he decided to原创 2016-07-20 00:39:07 · 477 阅读 · 0 评论 -
HDU 5748 Bellovin(最长上升子序列[nlogn])
BellovinTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 627 Accepted Submission(s): 291Problem DescriptionPeter has a seque原创 2016-07-25 10:47:13 · 582 阅读 · 0 评论 -
HDU 2546 饭卡 (变形01背包)
饭卡Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 21574 Accepted Submission(s): 7539Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即原创 2016-07-11 18:24:50 · 563 阅读 · 0 评论 -
矩形嵌套-记忆化搜索(dp动态规划)
矩形嵌套时间限制:3000 ms | 内存限制:65535 KB难度:4描述有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a<c,b<d或者b<c,a<d(相当于旋转X90度)。例如(1,5)可以嵌套在(6,2)内,但不能嵌套在(3,4)中。你的任务是选出尽可能多的矩形排成一行,使得除最后一个外,每一个矩原创 2015-07-29 20:12:30 · 902 阅读 · 0 评论 -
vijos - P1456最小总代价 (状态压缩DP + 记忆化搜索)
P1456最小总代价Accepted标签:[显示标签]描述n个人在做传递物品的游戏,编号为1-n。游戏规则是这样的:开始时物品可以在任意一人手上,他可把物品传递给其他人中的任意一位;下一个人可以传递给未接过物品的任意一人。即物品只能经过同一个人一次,而且每次传递过程都有一个代价;不同的人传给不同的人的代价值之间原创 2015-08-27 15:54:23 · 968 阅读 · 0 评论 -
P1193扫雷 (DP状态压缩)
P1193扫雷Accepted标签:[显示标签]描述相信大家都玩过扫雷的游戏。那是在一个n*n的矩阵里面有一些雷,要你根据一些信息找出雷来。万圣节到了,“余”任过流行起了一种简单的扫雷游戏,这个游戏规则和扫雷一样,如果某个格子没有雷,那么它里面的数字表示和他8连通的格子里面雷的数目。现在棋盘是n*2的,第一列里某些格子原创 2015-08-27 00:24:45 · 1231 阅读 · 0 评论 -
硬币找零-记忆化搜索(DP动态规划)
硬币找零时间限制:1000 ms | 内存限制:65535 KB难度:3描述在现实生活中,我们经常遇到硬币找零的问题,例如,在发工资时,财务人员就需要计算最少的找零硬币数,以便他们能从银行拿回最少的硬币数,并保证能用这些硬币发工资。我们应该注意到,人民币的硬币系统是 100,50,20,10,5,2,1,0.5,0.2,0.1,0.05,0.02,0原创 2015-07-30 09:28:58 · 3350 阅读 · 0 评论 -
Palindrome-最长公共子序列
C - PalindromeTime Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 1159DescriptionA palindrome is a symmetrical string, that is,原创 2015-07-25 19:09:59 · 701 阅读 · 0 评论 -
Common Subsequence-最长公共子序列
B - Common SubsequenceTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 1458DescriptionA subsequence of a given sequence is原创 2015-07-25 18:13:08 · 992 阅读 · 0 评论 -
天平问题
BalanceTime Limit: 1000MS Memory Limit: 30000K Total Submissions: 11238 Accepted: 6991 DescriptionGigel has a strange “balance” and he wants to poise it. Actually, the device is different from any原创 2015-03-04 13:31:32 · 871 阅读 · 0 评论 -
钱币兑换问题
E - 钱币兑换问题Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescription在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。 Input每原创 2015-07-07 15:12:24 · 903 阅读 · 0 评论 -
多重背包记录方案
题目:http://poj.org/problem?id=1787列表内容R - 多重背包记录方案 DescriptionCharlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffee at coffee vending machines at motor原创 2015-03-03 20:53:33 · 1114 阅读 · 0 评论 -
Maximum sum-动态规划
A - Maximum sumTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 2479DescriptionGiven a set of n integers: A={a1, a2,..., a原创 2015-07-25 17:14:21 · 1509 阅读 · 0 评论 -
Football-概率DP
F - FootballTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3071DescriptionConsider a single-elimination football tourn原创 2015-07-25 18:27:50 · 1079 阅读 · 2 评论 -
POJ 1088 滑雪
滑雪Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 82291 Accepted: 30770DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等原创 2015-06-21 21:31:37 · 665 阅读 · 0 评论 -
Greatest Common Increasing Subsequence-最长公共上升子序列
Greatest Common Increasing SubsequenceTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionThis is a problem from ZOJ 24原创 2015-07-28 00:47:47 · 1330 阅读 · 0 评论 -
最少拦截系统-贪心或最长上升子序列
最少拦截系统Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescription某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,原创 2015-07-27 09:44:30 · 1328 阅读 · 1 评论 -
ACdream 1420 High Speed Trains(容斥原理)
High Speed TrainsTime Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)Submit Statistic Next ProblemProblem Description The kingdom of Flatland has n c原创 2015-08-26 17:08:43 · 809 阅读 · 0 评论 -
ACdream 1216 Beautiful People(二维上升子序列 O(nlogn))
Beautiful PeopleSpecial Judge Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)Submit Statistic Next ProblemProblem Description The most prestig原创 2015-08-25 23:52:18 · 904 阅读 · 2 评论 -
HDU 1248寒冰王座-完全背包或记忆化搜索
寒冰王座Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13001 Accepted Submission(s): 6620Problem Description不死族的巫妖王发工资拉,死亡骑士拿到一张原创 2015-07-30 10:59:40 · 922 阅读 · 1 评论 -
Dividing-多重背包模板题
DividingTime Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionMarsha and Bill own a collection of marbles. They want to s原创 2015-07-28 16:33:55 · 1011 阅读 · 1 评论 -
Triangular Pastures-DP(有点像是暴力枚举)
POJ - 1948Triangular PasturesTime Limit: 1000MS Memory Limit: 30000KB 64bit IO Format: %I64d & %I64uSubmit StatusDescriptionLike everyone, cows enjoy variet原创 2015-07-28 21:20:39 · 1014 阅读 · 0 评论 -
I love sneakers!(最少分配一个问题)
题目链接I love sneakers!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4246 Accepted Submission(s): 1732Problem DescriptionAfter原创 2015-03-06 20:56:23 · 904 阅读 · 1 评论