DP
文章平均质量分 84
丶先森
这个作者很懒,什么都没留下…
展开
-
LightOJ - 1422 Halloween Costumes(区间DP模板)
B - Halloween Costumes LightOJ - 1422 a题目大意:给你n个数,每个数意味着一件衣服,你可以套多件衣服,但是一旦脱下来某件衣服,之后要是遇到这件衣服,必须重新穿一个新的,一共至少穿几个衣服 解题思路:这道题是个区间DP,区间DP一般有三层循环,第一层循环是区间的长度,第二层循环是区间头尾位置,第三层循环是在区间中找个中间值比较求极值原创 2017-04-08 16:09:01 · 528 阅读 · 0 评论 -
POJ1159Palindrome(区间dp回文串最长公共子序列+滚动数组模板)
Palindrome Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 62457 Accepted: 21761 Description A palindrome is a symmetrical string, that is, a string read i原创 2017-04-05 22:26:29 · 558 阅读 · 0 评论 -
【DP专辑】ACM动态规划总结
源博客链接:http://blog.csdn.net/cc_again/article/details/25866971 动态规划一直是ACM竞赛中的重点,同时又是难点,因为该算法时间效率高,代码量少,多元性强,主要考察思维能力、建模抽象能力、灵活度。 动态规划(英语:Dynamic programming,DP)是一种在数学、计算机科学和经济学中使用的,通过把转载 2017-04-14 22:01:54 · 259 阅读 · 0 评论 -
POJ1088滑雪(dp)
滑雪 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 96422 Accepted: 36568 Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等原创 2017-04-16 19:39:27 · 173 阅读 · 0 评论 -
hdu1231最大连续子序列(dp模板最大连续子序列)
最大连续子序列 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 31686 Accepted Submission(s): 14213 Problem Description 给定K个整数的序列{ N1, N2, .原创 2017-04-16 21:17:59 · 275 阅读 · 0 评论 -
POJ3616Milking Time(DP)
Milking Time Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9610 Accepted: 3992 Description Bessie is such a hard-working cow. In fact, she is so focused原创 2017-05-23 22:43:18 · 230 阅读 · 0 评论 -
Codeforces Round #319 (Div. 2)B. Modulo Sum(数学,DP)
B. Modulo Sum time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a sequence of numbers a1, a2, .原创 2017-05-18 21:03:37 · 308 阅读 · 0 评论 -
HDU - 5045 2014 ACM/ICPC Asia Regional Shanghai Online D - Contest (状压DP)
Contest Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1820 Accepted Submission(s): 735 Problem Description In the ACM Internationa原创 2017-05-31 22:08:14 · 268 阅读 · 0 评论 -
Codeforces Round #383 (Div. 2) D. Arpa's weak amphitheater and Mehrdad's valuable Hoses(并查集+分组背包)
D. Arpa's weak amphitheater and Mehrdad's valuable Hoses time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Jus原创 2017-08-23 18:51:15 · 233 阅读 · 0 评论 -
HDU2639 Bone Collector II(01背包变形)
级第42届ACM国际大学生程序设计竞赛全球总决赛 Bone Collector II Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5490 Accepted Submission(s): 2901原创 2018-02-05 15:17:36 · 138 阅读 · 0 评论 -
HDU 1011(树形DP)
Starship TroopersTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21216 Accepted Submission(s): 5652Problem DescriptionYou, the leader of Sta...原创 2018-02-10 19:34:39 · 319 阅读 · 0 评论 -
POJ - 1050 To the Max(区间DP最大字串和,最大子矩阵和模板)
To the Max Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 48400 Accepted: 25619 Description Given a two-dimensional array of positive and negative integer原创 2017-04-05 22:17:27 · 471 阅读 · 0 评论 -
Codeforces Round #237 (Div. 2) D. Minesweeper 1D
D. Minesweeper 1D time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Game "Minesweeper 1D" is played on a line原创 2017-04-28 15:30:34 · 405 阅读 · 0 评论 -
POJ2955Brackets(区间DP模板题)
Brackets Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7556 Accepted: 4020 Description We give the following inductive definition of a “regular bracket原创 2017-04-08 16:16:02 · 263 阅读 · 0 评论 -
POJ1651Multiplication Puzzle(区间dp)
Multiplication Puzzle Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9836 Accepted: 6083 Description The multiplication puzzle is played with a row of car原创 2017-04-08 16:53:00 · 204 阅读 · 0 评论 -
POJ1837Balance(动态规划01背包)
Balance Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 14322 Accepted: 9013 Description Gigel has a strange "balance" and he wants to poise it. Actually,原创 2017-03-31 22:14:16 · 259 阅读 · 0 评论 -
HDU - 2955(动态规划01背包)
Robberies Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 22786 Accepted Submission(s): 8401 Problem Description The aspiring Roy th原创 2017-03-31 22:00:04 · 376 阅读 · 0 评论 -
POJ3624Charm Bracelet(动态规划(DP)01背包模板)
Charm Bracelet Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 38166 Accepted: 16561 Description Bessie has gone to the mall's jewelry store and spies a ch原创 2017-03-31 21:45:15 · 256 阅读 · 0 评论 -
HDU114Piggy-Bank(完全背包模板题)
Piggy-Bank Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 23622 Accepted Submission(s): 11962 Problem Description Before ACM can do原创 2017-04-01 23:54:39 · 369 阅读 · 0 评论 -
POJ2063Investment
Investment Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 10506 Accepted: 3693 Description John never knew he had a grand-uncle, until he received the not原创 2017-04-01 23:58:36 · 227 阅读 · 0 评论 -
HDU - 1712ACboy needs your help(分组背包模板题)
ACboy needs your help Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6959 Accepted Submission(s): 3857 Problem Description ACboy ha原创 2017-04-04 21:50:43 · 332 阅读 · 0 评论 -
HDU - 2159(二维费用背包模板题)
FATE Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13380 Accepted Submission(s): 6327 Problem Description 最近xhd正在玩一款叫做FATE的游戏,为了得到原创 2017-04-04 21:54:44 · 727 阅读 · 0 评论 -
HDU - 2191悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包模板题)
悼念512汶川大地震遇难同胞——珍惜现在,感恩生活 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 28347 Accepted Submission(s): 11868 Problem Description 急!原创 2017-04-04 21:59:30 · 186 阅读 · 0 评论 -
数位DP
基础篇 数位dp是一种计数用的dp,一般就是要统计一个区间[le,ri]内满足一些条件数的个数。所谓数位dp,字面意思就是在数位上进行dp咯。数位还算是比较好听的名字,数位的含义:一个数有个位、十位、百位、千位......数的每一位就是数位啦! 之所以要引入数位的概念完全就是为了dp。数位dp的实质就是换一种暴力枚举的方式,使得新的枚举方式满足dp的性质,然后记忆化就可以了。转载 2018-02-07 17:36:24 · 165 阅读 · 0 评论