
DP
文章平均质量分 79
EIKY
这个作者很懒,什么都没留下…
展开
-
“师创杯”精英赛G---限额逃生2(BFS)---已AC+错误分析
Problem G: G-险恶逃生IITime Limit: 1 Sec Memory Limit: 128 MBSubmit: 27 Solved: 5[Submit][Status][Web Board]Description SOS!!!koha is trapped in the dangerous maze.He need your help a原创 2015-04-16 13:48:40 · 628 阅读 · 0 评论 -
SDUT-2169-Sequence(DP)
题目链接:http://www.sdutacm.org/sdutoj/problem.php?action=showproblem&problemid=2169Problem DescriptionGiven an integer number sequence A of length N (1<=N<=1000), we define f(i,j)=(A[i]+A[i+1]+..原创 2016-05-25 19:13:34 · 392 阅读 · 0 评论 -
HDUT-2408-Pick apples(贪心+背包)
Pick applesTime Limit: 1000ms Memory limit: 165536K 有疑问?点这里^_^题目描述Once ago, there is a mystery yard which only produces three kinds of apples. The number of each kind is infinite. A g原创 2016-05-03 10:42:20 · 401 阅读 · 0 评论 -
SDUT-2878-Circle(概率DP/高斯消元)
CircleTime Limit: 2000ms Memory limit: 65536K 有疑问?点这里^_^题目描述You have been given a circle from 0 to n - 1. If you are currently at x, you will move to (x - 1) mod n or (x + 1原创 2016-04-28 21:27:20 · 390 阅读 · 0 评论 -
HDU-5691-Sitting in Line(状压DP)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5691Description度度熊是他同时代中最伟大的数学家,一切数字都要听命于他。现在,又到了度度熊和他的数字仆人们玩排排坐游戏的时候了。游戏的规则十分简单,参与游戏的N个整数将会做成一排,他们将通过不断交换自己的位置,最终达到所有相邻两数乘积的和最大的目的,参与游戏的数字有整数也原创 2016-05-23 17:34:09 · 298 阅读 · 0 评论 -
HDU-5763-Another Meaning(KMP+DP)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5763题意:给出字符串a,b,其中,字符串b代表两种含义,问a最多有多少种含义。题解:kmp找出b在a中对应的位置,根据位置关系dp令dp[i]表示到i结尾的字符串可以表示的不同含义数,那么考虑两种转移:末尾不替换含义:dp[i - 1]末尾替换含义:dp[i - |B|原创 2016-07-29 11:00:04 · 290 阅读 · 0 评论 -
BZOJ-1026-windy数(数位DP)
链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1026题意:windy定义了一种windy数。不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。 windy想知道,在A和B之间,包括A和B,总共有多少个windy数题解:数位DP, dp[i][j]表示长度为i,最高位为j的windy数个数。#inclu原创 2016-08-03 16:30:20 · 279 阅读 · 0 评论 -
HDU-2089-不要62(数位DP)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=2089题意:求[L,R]间数字中不含4和62的个数题解:数位DPCODE:#include using namespace std;#define INF 0x3f3f3f3fint dp[10][5];///dp[i][j]:int a[20];int solve(in原创 2016-08-04 10:54:24 · 345 阅读 · 0 评论 -
HDU-3555-Bomb(数位DP)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=3555题意:求1-n中含有49数字的个数;题解:数位DPCODE:#include using namespace std;#define INF 0x3f3f3f3flong long dp[25][5];int a[20];/// dp[i][0] i 不含4原创 2016-08-04 15:31:42 · 330 阅读 · 0 评论 -
HDU-3709-Balanced Number(数位DP+记忆化DFS)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=3709题意:求[a,b]区间内Balanced Number的个数,Balanced Number:当前数以某点p为支点满足sigma a[i]*(i-p) =0,(即物理杠杆平衡)题解:数位DP,dp[pos][ful][sum],///dp[当前位][支点][合力],枚举支点,记忆化搜索并记录已原创 2016-08-05 13:31:44 · 304 阅读 · 0 评论 -
HDU-5791-Two(DP)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5791题意:给出数组a[n],b[m],求其有多少不连续公共子串(可重复)题解:dp[i][j]表示A序列前i个数和B序列前j个数的相同子序列对有多少个。1,a[i]==b[j]时,dp[i][j]=dp[i-1][j]+dp[i][j-1]+1 ,其中1表示a[i]与b[j]单独配对,显然原创 2016-08-02 21:11:45 · 327 阅读 · 0 评论 -
HDU-5900-QSC and Master(区间DP)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5900题意:给出数组a[],每个数a[i]对应一个权值val[i],若相邻两数不互质,则可以消除,消除后剩余两区间合并形成新数组仍可以进行消除操作,问消除的最大权值和题解:预处理出可消除的连续区间,然后区间dp。CODE:#include #define maxn 307#def原创 2016-09-21 18:42:29 · 274 阅读 · 0 评论 -
HDU-5067-Harry And Dig Machine(状压DP)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5067DP[i][j]表示在已经经过状态为i的格子的情况下,当前在j点的最短路径;显然有 DP[i][j]=min( DP[i][j], dp[i|k][p] + dis[p][j] )#pragma comment(linker, "/STACK:1024000000,10原创 2017-04-02 15:11:32 · 569 阅读 · 0 评论 -
ZOJ-3469-Food Delivery(区间DP)
DescriptionWhen we are focusing on solving problems, we usually prefer to stay in front of computers rather than go out for lunch. At this time, we may call for food delivery.Suppose there are原创 2016-04-16 14:47:01 · 531 阅读 · 0 评论 -
HDU---1561-The more, The Better (树形DP)
The more, The BetterTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6557 Accepted Submission(s): 3850Problem DescriptionACboy很喜欢玩原创 2015-10-30 20:03:37 · 372 阅读 · 0 评论 -
YTU ---1914- 找零钱(DP)
1914: 找零钱Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 17 Solved: 6[Submit][Status][Web Board]Description我们知道人民币有1、2、5、10、20、50、100这几种面值。 现在给你 n(1≤n≤250)元,让你计算换成用上面这些面额表示且总数不超过100张,共有几种。原创 2015-05-07 16:57:46 · 1131 阅读 · 0 评论 -
HDU---1024-Max Sum Plus Plus(DP)
Max Sum Plus PlusTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19575 Accepted Submission(s): 6457Problem DescriptionNow I think原创 2015-05-30 22:11:49 · 432 阅读 · 0 评论 -
HDU---1466-计算直线的交点数(DP)
计算直线的交点数 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 8 Accepted Submission(s) : 2Font: Times New Roman | Verdana | Georgia Font Size原创 2015-05-31 21:31:48 · 496 阅读 · 0 评论 -
HDU---1160-FatMouse's Speed (DP)
FatMouse's Speed Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 17 Accepted Submission(s) : 8Special Judge Font: Times New Roman | Verd原创 2015-06-20 18:59:26 · 367 阅读 · 0 评论 -
HDU---1114-Piggy-Bank (背包)
Piggy-Bank Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 13 Accepted Submission(s) : 5Font: Times New Roman | Verdana | Georgia Font S原创 2015-06-22 14:43:29 · 333 阅读 · 0 评论 -
HDU---1087-Super Jumping! Jumping! Jumping!(DP)
Super Jumping! Jumping! Jumping! Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 19 Accepted Submission(s) : 6Font: Times New Roman | Verd原创 2015-06-22 14:47:56 · 395 阅读 · 0 评论 -
HDU---1176-免费馅饼(DP)
免费馅饼 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 17 Accepted Submission(s) : 7Font: Times New Roman | Verdana | Georgia Font Size: ←原创 2015-06-22 14:54:59 · 354 阅读 · 0 评论 -
HDU---1048-Humble Numbers (DP)
Humble Numbers Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 30 Accepted Submission(s) : 13Font: Times New Roman | Verdana | Georgia F原创 2015-06-22 15:00:56 · 356 阅读 · 0 评论 -
POJ---1080-Human Gene Functions
D - Human Gene FunctionsTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionIt is well known that a human gene can be considered a原创 2015-08-13 10:33:53 · 392 阅读 · 0 评论 -
POJ---2192-Zipper
A - ZipperTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionGiven three strings, you are to determine whether the third string c原创 2015-08-13 10:36:18 · 407 阅读 · 0 评论 -
POJ---1159-Palindrome(01DP)
E - PalindromeTime Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionA palindrome is a symmetrical string, that is, a string read ident原创 2015-08-13 14:49:16 · 404 阅读 · 0 评论 -
HDU-5064-Find Sequence(DP)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=5064dp[i][j]表示以第j个为结尾,且上一个为第i个的最长序列长度。由于序列递增,当前i,对于ki不必重复枚举其中一边,总复杂度O(n*n)#pragma comment(linker, "/STACK:1024000000,1024000000")#include #incl原创 2017-04-03 19:32:45 · 356 阅读 · 0 评论