#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int a;
string c[2];
cin>>a>>c[0]>>c[1];
multiset<char> s[2][2];
for(int x=0;x<a;x++)
for(int y=0;y<2;y++)
s[x%2][y].insert(c[y][x]);
cout<< (s[0][0] == s[0][1] && s[1][0] == s[1][1] ? "TAK" : "NIE");
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int a; string c[2]; cin>>a>>c[0]>>c[1]; multiset<char> s[2][2]; for(int x=0;x<a;x++) for(int y=0;y<2;y++) s[x%2][y].insert(c[y][x]); cout<< (s[0][0] == s[0][1] && s[1][0] == s[1][1] ? "TAK" : "NIE"); return 0; } |
English