题目链接。
AC代码如下;
#include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <string> #include <queue> #include <algorithm> #include <map> #include <ctype.h> #include <set> using namespace std; const int maxn = 1000+10; int main() { int T, n, cn; bool flag; char s1[maxn], s2[maxn], s3[maxn], s[maxn]; scanf("%d", &T); for(int kase=1; kase<=T; kase++) { set<string> st; cn = 0; flag = true; scanf("%d", &n); scanf("%s%s%s", s1, s2, s3); while(true) { cn++; for(int i=0; i<n; i++) { s[2*i] = s2[i]; s[2*i+1] = s1[i]; }
s[2*n] = '