- 博客(7)
- 收藏
- 关注
转载 区间DP-POJ 3186 Treats for the Cows
题目链接:http://poj.org/problem?id=3186题意:给一个数组v,每次可以取前面的或者后面的,第k次取的v[i]价值为v[i]*k,问总价值最大是多少。区间dp。设dp[i][j] 为 取i到j后 的最大值,可能由d[i+1][j]或者d[i][j-1]转移而来。转移方程:dp[i][j]=max(dp[i+1][j]+p[i]*(n+i-j),dp[i][j-1]+p[j...
2018-04-14 21:46:25 176
原创 DP-POJ3616
Milking Time POJ - 3616 解题思路:对时间段进行排序后,套上两重for循环,dp[i] 表示到第i个牧场的时候最大产量动态转移方程为:if(f[i].x>=f[j].y+r) dp[i]=max(dp[i],dp[j]+f[i].e);代码如下:#include<iostream>#include<cstdio>#include<...
2018-04-14 21:21:53 231
转载 状压DP-HDU 1074
Doing HomeworkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4685 Accepted Submission(s): 1917Problem DescriptionIgnatius has just come back...
2018-04-14 16:13:32 162
原创 DP-免费馅饼-HDU-1176
免费馅饼Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26971 Accepted Submission(s): 9186HDU - 1176 Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回...
2018-04-14 13:33:55 203
原创 DP-前n个数的最大升序子段和问题-HDU1087
Super Jumping! Jumping! Jumping! HDU - 1087 Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, ...
2018-04-14 10:48:32 554
原创 DP-多段子段和最大值问题HDU-1024
Max Sum Plus Plus HDU - 1024 题目大意就是求多段不相交的子段和的最大值。动态规划的问题,需要先写出动态转移方程,可以先这么思考:dp[i][j]代表的是前j个数组成i组的最大值,那方程为:dp[i][j]=max( dp[i][j-1]+a[j] , max(dp[i-1][k])+a[j] ) (0<k<j)子问题为第j个数是包含在第i组中还是自己独...
2018-04-13 16:00:58 277
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人