![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
dp
文章平均质量分 87
To_be_strong
一步一个脚印
展开
-
南阳ccpc D题 Pick The Sticks
Pick The Sticks Time Limit: 15000/10000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status The story happened long long ago. One day, Cao Cao made a special原创 2015-10-27 20:35:34 · 752 阅读 · 0 评论 -
HDU 2476 String painter(区间dp)
Problem Description There 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原创 2016-02-20 14:50:28 · 543 阅读 · 0 评论 -
poj 3280 Cheapest Palindrome(区间dp)
题目链接:http://poj.org/problem?id=3280; 题意:给你一个字符串,然后给你一个字符表,里面有删除和添加这个字符的代价,问你把他最后变成回文串的最小代价。 思路:我们可以dp[i][j]表示从第i个字符到第j个字符变成回文串的最小代价,然后对应dp[i+1][j]和dp[i][j-1]我们可以选择删除和添加对应字符的最小代价,如果s[i] == s[j] 的话,就直原创 2016-02-17 10:24:57 · 518 阅读 · 0 评论 -
UVALive - 3942 Remember the Word(trie + dp)
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=22109; 思路:dp[i]表示原串从i开始的后段子串的方案数,从后往前dp,然后dp[i] = sum(dp[i + len(x)],这里的x是给出单词并且是这后段的前缀串。如果直接枚举的话会超时,先把单词全部加到字典树上面然后在字典树上面查找就可以了。我是用指针原创 2016-02-16 15:36:26 · 663 阅读 · 0 评论 -
lightoj 1011 - Marriage Ceremonies(状态压缩dp)
Time Limit: 2 second(s) Memory Limit: 32 MB You work in a company which organizes marriages. Marriages are not that easy to be made, so, the job is quite hard for you. The job gets more d原创 2016-04-02 12:21:48 · 551 阅读 · 0 评论 -
lightoj 1033 - Generating Palindromes(区间dp)
1033 - Generating Palindromes PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB By definition palindrome is a string which is not原创 2016-04-07 22:33:24 · 692 阅读 · 0 评论 -
lightoj 1017 - Brush (III)(dp)
1017 - Brush (III) PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Samir returned home from the contest and got angry after seei原创 2016-04-09 10:25:34 · 365 阅读 · 0 评论 -
HDU 5677 ztr loves substring (dp)
Problem Description ztr love reserach substring.Today ,he has n string.Now ztr want to konw,can he take out exactly k palindrome from all substring of these n string,and thrn sum of length of these原创 2016-05-01 12:08:07 · 931 阅读 · 4 评论 -
lightoj 1283 1283 - Shelving Books(dp)
#include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; int INF = 0x3f3f3f3f; const int N = 1e2 + 10; int dp[N][N][N], a[N], b[N], c原创 2016-05-20 23:16:29 · 629 阅读 · 0 评论 -
HDU 5616 Jam's balance(dp)
Jam's balance Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 356 Accepted Submission(s): 163 Problem Description Jim has a bala原创 2016-01-31 20:45:27 · 906 阅读 · 2 评论 -
HDU 3001 Travelling(状态压缩dp)
Travelling Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5765 Accepted Submission(s): 1858 Problem Description After coding so原创 2016-01-29 19:36:17 · 707 阅读 · 0 评论 -
HDU 3091 Necklace (状态压缩dp)
#include #include #include #include #include #include #include #include #include using namespace std; const int N = (1<<18) + 10; const double eps = 1e-10; typedef long long ll; ll dp[N][20]; int Map[原创 2016-01-28 18:50:29 · 544 阅读 · 0 评论 -
HDU 5375 Gray code
Gray code Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 983 Accepted Submission(s): 548 Problem Description The reflected bina原创 2015-11-07 21:21:03 · 333 阅读 · 0 评论 -
HDU 5532 Almost Sorted Array
Almost Sorted Array Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 570 Accepted Submission(s): 234 Problem Description We are原创 2015-11-06 21:30:39 · 424 阅读 · 0 评论 -
南阳ccpc C题 The Battle of Chibi(树状数组优化+dp)
The Battle of Chibi Time Limit: 6000/4000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status Cao Cao made up a big army and was going to invade the whole So原创 2015-10-29 22:14:09 · 1618 阅读 · 0 评论 -
hdu 5569 matrix(dp)
matrix Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 329 Accepted Submission(s): 199 Problem Description Given a matrix with n原创 2015-11-23 16:59:12 · 280 阅读 · 0 评论 -
hdu5568 sequence2(dp + 高精度)
sequence2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 385 Accepted Submission(s): 151 Problem Description Given an integer a原创 2015-11-23 16:52:03 · 295 阅读 · 0 评论 -
51Nod 算法马拉松7 B选数字
选数字 System Message (命题人) 基准时间限制:1 秒 空间限制:131072 KB 分值: 80 当给定一个序列a[0],a[1],a[2],...,a[n-1] 和一个整数K时,我们想找出,有多少子序列满足这么一个条件:把当前子序列里面的所有元素乘起来恰好等于K。 样例解释: 对于第一个数据,我们可以选择[3]或者[原创 2015-11-01 22:20:12 · 444 阅读 · 0 评论 -
fzuoj 2218 Simple String Problem(状态压缩dp)
Problem 2218 Simple String Problem Accept: 10 Submit: 40 Time Limit: 2000 mSec Memory Limit : 32768 KB Problem Description Recently, you have found your interest in string theory. H原创 2015-12-29 21:14:09 · 1052 阅读 · 0 评论 -
POJ 1661Help Jimmy(dp)
Help Jimmy Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9708 Accepted: 3147 Description "Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平台原创 2015-12-04 22:48:05 · 318 阅读 · 0 评论 -
lightoj 1122 - Digit Count(dp)
Time Limit: 2 second(s) Memory Limit: 32 MB Given a set of digits S, and an integer n, you have to find how many n-digit integers are there, which contain digits that belong to S and the d原创 2016-04-07 22:41:09 · 740 阅读 · 0 评论