![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
acm_动态规划
小k安达
不乱于心,不困于情,不畏将来,不念过往,如此,安好!
展开
-
2017-金马五校程序设计竞赛-E -Find Palindrome
Description Given a string S, which consists of lowercase characters, you need to find the longest palindromic sub-string.A sub-string of a string S is another string S’ that occurs “in” S. For exam原创 2017-06-04 13:38:22 · 261 阅读 · 0 评论 -
HUD-1087(dp)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1087大致题意:只能从小的往大的跳 求走过的和最大。code:/** http://acm.hdu.edu.cn/showproblem.php?pid=1087 */ #include <cstdio> #include <algorithm> #define maxn 10...原创 2018-05-10 18:13:18 · 269 阅读 · 0 评论 -
最长上升子序列 O(n*n) & O(n*log(n))
练习题目:https://www.nowcoder.com/questionTerminal/d83721575bd4418eae76c916483493decode O(n^2):#include <cstdio> #include <algorithm> #define MAXN 1010 using namespace std; int a[MAXN] , dp[MA...原创 2018-05-10 17:24:54 · 390 阅读 · 0 评论 -
牛客网 B-Big Water Problem(树状数组)
题目链接题目描述 给一个数列,会有多次询问,对于每一次询问,会有两种操作: 1:给定两个整数x, y, 然后在原数组的第x位置上加y; 2:给定两个整数l,r,然后输出数组从第l位加到第r位数字的和并换行 输入描述:第一行有两个整数n, m(1 <= n, m <= 100000)代表数列的长度和询问的次数 第二行n个数字,对于第i个数字a[i],(0<=a[...原创 2018-02-26 16:11:57 · 283 阅读 · 0 评论 -
HDU 2391 Filthy Rich(动态规划)
Problem Description They say that in Phrygia, the streets are paved with gold. You’re currently on vacation in Phrygia, and to your astonishment you discover that this is to be taken literally: sma原创 2017-11-19 13:31:40 · 276 阅读 · 0 评论 -
hdu-2159-FATE(二维费用完全背包)
FATE Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 15711 Accepted Submission(s): 7406 Problem Description 最近xhd正在玩一款叫做FATE的游戏,原创 2017-11-03 19:27:26 · 235 阅读 · 0 评论 -
hdu-1171-Big Event in HDU(背包)
Big Event in HDU Time Limit : 10000/5000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 27 Accepted Submission(s) : 10 Problem Description Nowadays, we a原创 2017-11-03 15:12:08 · 320 阅读 · 0 评论 -
hdu-2602-Bone Collector(01背包)
题目链接 题意:N是物品个数,V是容量 第一排是价值,第二排是体积。 思路:这是一个基础的01背包题。。。 code: #include #include #include using namespace std; const int MAXN = 1010; int dp[MAXN],v[MAXN],w[MAXN]; int main() { int T,n,m;原创 2017-11-03 15:20:39 · 279 阅读 · 0 评论 -
hdu-1059-Dividing(多重背包+二进制优化)
Dividing Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 27731 Accepted Submission(s): 7966 Problem Description Marsha and Bill own a coll原创 2017-11-12 11:09:30 · 655 阅读 · 0 评论 -
hdu-2844-Coins (多重背包+二进制优化)
Coins Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 9 Accepted Submission(s) : 5 Problem Description Whuacmers use coins.They have coins of原创 2017-11-12 11:08:03 · 319 阅读 · 0 评论 -
hdu-2191-悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
题目链接 题意:无(中文题) 思路:多重背包问题 ,化成01背包做。 code: #include #include #include using namespace std; const int maxn=10010; int dp[maxn]; int w[maxn],v[maxn]; int main() { int T,n,m; scanf("%d",&T原创 2017-11-06 20:34:32 · 223 阅读 · 0 评论 -
hdu-6092-Rikka with Subset(思维)
题目链接 Rikka with Subset Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1540 Accepted Submission(s): 779 Problem Description原创 2017-08-13 09:46:05 · 279 阅读 · 0 评论 -
hdu-2084-数塔(金典dp题目)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2084从最下层往上走 第i层 第j个位置dp[i][j]=max(dp[i+1][j],dp[i+1][j+1])+a[i][j];code:#include<cstdio> #include<cstring> #include<algorithm> using n...原创 2018-05-14 18:32:13 · 354 阅读 · 0 评论