#include<bits/stdc++.h>
using namespace std;
long long n;
int bitus[26][2], bajtus[26][2];
char x;
int main(){
iostream::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for(int i = 0;i<n;i++){
cin >> x;
bitus[x-'a'][i%2]++;
}
for(int i = 0;i<n;i++){
cin >> x;
bajtus[x-'a'][i%2]++;
}
for(int i = 0; i < 26; i++)
for(int j = 0; j < 2; j++){
if(bitus[i][j]!=bajtus[i][j]){
cout << "NIE";
return 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 31 32 33 | #include<bits/stdc++.h> using namespace std; long long n; int bitus[26][2], bajtus[26][2]; char x; int main(){ iostream::sync_with_stdio(false); cin.tie(0); cin >> n; for(int i = 0;i<n;i++){ cin >> x; bitus[x-'a'][i%2]++; } for(int i = 0;i<n;i++){ cin >> x; bajtus[x-'a'][i%2]++; } for(int i = 0; i < 26; i++) for(int j = 0; j < 2; j++){ if(bitus[i][j]!=bajtus[i][j]){ cout << "NIE"; return 0; } } cout << "TAK"; return 0; } |
English