#include <cstdio> int n, t[512]; int main () { scanf ("%i", &n); for (int i=1; i>=-1; i-=2) for (int j=0*scanf(" "); j<n; j++) t[j%2*256+getchar()] += i; for (int j=0; j<512; j++) if (t[j]) return 0 * puts ("NIE"); return 0 * puts ("TAK"); }
1 2 3 4 5 6 7 8 9 10 11 | #include <cstdio> int n, t[512]; int main () { scanf ("%i", &n); for (int i=1; i>=-1; i-=2) for (int j=0*scanf(" "); j<n; j++) t[j%2*256+getchar()] += i; for (int j=0; j<512; j++) if (t[j]) return 0 * puts ("NIE"); return 0 * puts ("TAK"); } |