http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=970
通过对每一个字符串,每一个位置进行枚举三个操作,然后二分查找操作后的字符串是否存在,dp记录。
1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #define N 25000 5 using namespace std; 6 7 char g[N][30]; 8 char s[30]; 9 int dp[N*10]; 10 11 void change(char *g,char *s,int pos,char ch) 12 { 13 int k=strlen(g); 14 for(int i=0; i<k; i++) 15 { 16 s[i]=g[i]; 17 } 18 s[pos]=ch; 19 s[k]='