http://acm.hdu.edu.cn/showproblem.php?pid=1501
两种做法:1.dfs,2,直接推

1 #include <cstdio> 2 #include <iostream> 3 #include <cstring> 4 #include <algorithm> 5 #define maxn 1000 6 using namespace std; 7 8 int dp[maxn][maxn]; 9 char str1[maxn],str2[maxn],str3[maxn]; 10 bool flag; 11 bool vis[maxn][maxn]; 12 13 void dfs(int p1,int p2,int pos) 14 { 15 if(str3[pos]=='