www.pudn.com > zju_1000_1010.rar > 1004_other3.cpp
#include#include #include const int max=5; static int q1,q2; char str[max][2][20]; int solve[max][10][20]; static int flag[20]; static int total[max]; int po[20]; void doing(int p,int wh,int len){ if(p==len){ int tt;int t_flag2=q2,t_flag1=q1; for( tt=p;tt<=len-q2-1;tt++){ if(str[wh][1][q1-1]!=str[wh][2][q2]) break; else{ po[p++]=1; q1--;q2++;}} if(tt==len-q2){total[wh]++; for(int pp=0;pp >str[k][1]>>str[k][2])k++; int i; for(i=1;i