摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4323去年的多校 编辑距离的变形 暴力居然过了 还想了好久别的方法,想得很头疼 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int dp[12][12],kk[1510],num[1010]; 8 char s[1510][12],ss[12]; 9 int main()10 {11 int i,j,k,n,m,t,a,b,o=0,g;12 scanf("%d",&t 阅读全文
posted @ 2013-08-12 19:39 _雨 阅读(199) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4374去年多校的题 今年才做 不知道这一年都干嘛去了。。DP的思路很好想 dp[i][j] = max(dp[i-1][g]+sum[i][j]-sum[i][g-1],dp[i][j]) abs(g-j) 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define N 105 8 #define M 10005 9 #define LL __int6410 int a[N][M],que[M];11 int dp[ 阅读全文
posted @ 2013-08-12 14:33 _雨 阅读(337) 评论(1) 推荐(0) 编辑