![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划-区间DP
文章平均质量分 63
___Evan
这个作者很懒,什么都没留下…
展开
-
POJ-1141 Brackets Sequence 经典区间DP
题目链接 状态转移方程: dp[i][j] = min( dp[i][j], dp[i+1][j-1] ); //( str[i] == '(' && str[j] == ')' ) || ( str[i] == '[' && str[j] == ']' ) dp[i][j] = min( dp[i][j],原创 2014-04-03 21:01:18 · 402 阅读 · 0 评论 -
fafu—1174 编辑距离 DP
#include "stdio.h" #include "string.h" char str[105],sub[105]; int dp[105][105]; int min(int a,int b,int c) { if(a>b) a=b; if(a>c) a=c; return a; } int main() { int t,i,j; scanf("%d",&t); ge原创 2013-11-02 22:27:23 · 515 阅读 · 0 评论 -
蓝桥杯算法训练 乘积最大
#include #include #include #include #include #include #include using namespace std; const int maxn = 55; int n,m; int num[maxn],dp[maxn][maxn]; int GetVal( int s,int e ) { int ans = 0; for( in原创 2014-05-05 18:48:13 · 1053 阅读 · 0 评论 -
Lightoj 1031 - Easy Game DP
题目链接 #include #include #include #include #include #include #include #include using namespace std; const int maxn = 105; const int inf = 1<<30; int n,m; int num[maxn],sum[maxn],dp[maxn]原创 2014-05-18 14:08:18 · 549 阅读 · 0 评论 -
Light-1037 Agent 47 DP
#include #include #include #include #include #include #include #include using namespace std; const int maxn = 20; const int inf = 1<<30; int n,m; int map[maxn][maxn],dp[1<<16],hp[maxn]; void Ge原创 2014-05-18 15:15:12 · 436 阅读 · 0 评论 -
Light oj 1422 Halloween Costumes 区间DP
#include "stdio.h" #include "math.h" #include "string.h" #include "algorithm" using namespace std; const int maxn = 105; int n; int dp[maxn][maxn],c[maxn]; void GetDp() { for( int i = 1; i <= n; i ++原创 2014-07-10 18:36:52 · 342 阅读 · 0 评论 -
poj-1651 Multiplication Puzzle 区间DP
#include #include #include #include #include #include #include #include using namespace std; const int maxn = 105; const int inf = 1<<30; int n; int num[maxn],dp[maxn][maxn]; void GetDp() { memset( d原创 2014-07-12 17:11:21 · 340 阅读 · 0 评论