摘要:http://poj.org/problem?id=1458#include<iostream> #include<cstdio>#include<cstring>using namespace std;const int MAXN=1000;char sz1[MAXN];char sz2[MAXN];int dp[MAXN+10][MAXN+10];/*最后一个字符相同dp[i][j]=dp[i
阅读全文
摘要:http://poj.org/problem?id=1661 #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #defin
阅读全文
摘要:#include<iostream> using namespace std; #define MAX_N 100 int N; int b[MAX_N + 10]; int aMaxLen[MAX_N + 10]; int r[MAX_N + 10];//记录路径 /* 7 1 7 3 5 9 4
阅读全文
摘要:程序设计导引及在线实践 第一种解法,直接递归,优化后,改为逆推动态规划 打印路径,可以反过来计算。 #include<iostream> using namespace std; #define MAX_NUM 100 int A[MAX_NUM + 10][MAX_NUM + 10]; int D
阅读全文