#include <iostream> using namespace std; int n, t1a[26], t1b[26], t0a[26], t0b[26], ok; string a, b; int main() { std::ios_base::sync_with_stdio(0); cin>>n>>a>>b; for(int i=0;i<n;i++) { if(i%2==0) { t0a[a[i]-97]++; t0b[b[i]-97]++; } else { t1a[a[i]-97]++; t1b[b[i]-97]++; } } for(int i=0;i<26;i++) { if(t0a[i]!=t0b[i]) {ok=1; cout<<"NIE"; break;} if(t1a[i]!=t1b[i]) {ok=1; cout<<"NIE"; break;} } if(ok==0) cout<<"TAK"; return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include <iostream> using namespace std; int n, t1a[26], t1b[26], t0a[26], t0b[26], ok; string a, b; int main() { std::ios_base::sync_with_stdio(0); cin>>n>>a>>b; for(int i=0;i<n;i++) { if(i%2==0) { t0a[a[i]-97]++; t0b[b[i]-97]++; } else { t1a[a[i]-97]++; t1b[b[i]-97]++; } } for(int i=0;i<26;i++) { if(t0a[i]!=t0b[i]) {ok=1; cout<<"NIE"; break;} if(t1a[i]!=t1b[i]) {ok=1; cout<<"NIE"; break;} } if(ok==0) cout<<"TAK"; return 0; } |