- 博客(6)
- 收藏
- 关注
原创 poj 1185 状态压缩dp
题目链接:http://poj.org/problem?id=1185 第i行的状态由第I-1行和第i-2行决定 dp[i][j][k] = max(dp[i][j][k],dp[i-1][k][p]+cou[j]); 初始化第i=0行就够了,因为不会访问i-2 #include //改成c++就过原来用c的,wal#include int n,m; int sta[6
2015-11-29 22:52:55 260
原创 hdu 1502 大数dp
题目链接: 转移方程 #include #include char dp[65][65][65][80]; int i,j,k; int max(int a,int b) { if(a > b) return a; return b; } void add(char a[],char b[],char c[]) { int len1,
2015-11-19 21:07:07 802
原创 hdu 3008
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3008 Input There are several test cases,intergers n ,t and q (00) in the first line which mean you own n kinds of skills ,and the "ResumingCircle
2015-11-16 23:19:38 745
原创 hdu 1501
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1501 题意:判断能不能由前前两段字符组成第三段字符 转移方程: dp[i][j] = (dp[i][j-1]&&str2[j-1]==str3[i+j-1]) || (dp[i-1][j] && str1[i-1]==str3[i+j-1])) str1[]的前I个字符和str2[]的前j个
2015-11-16 23:12:16 279
原创 hdu 1224
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1224 题意:求最长上升子序列,有路径限制 #include #include int dp[120]; int map[120][120]; int pre[120]; int num[120]; void p(int x) { if(pre[x] == 1) {
2015-11-13 20:29:32 249
原创 hdu 1081(最大子矩阵和)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1081 先求每列第一个元素到每个元素的和 s[i][j] = s[i-1][j] + num[i][j]; 在求第i行到 j 行的每列的和(1 每求出一组t[n],求一次最大字段和 #include #include int s[110][110]; int num[11
2015-11-04 21:36:01 292
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人