#include <bits/stdc++.h>
using namespace std;
int tab1[28],tab2[28];
int main()
{
int n;
char c;
scanf("%d",&n);
getchar_unlocked();
for(int i=0 ; i<n ; ++i)
{
c=getchar_unlocked();
tab1[c-'a']++;
}
getchar_unlocked();
for(int i=0 ; i<n ; ++i)
{
c=getchar_unlocked();
tab2[c-'a']++;
}
getchar_unlocked();
for(int i=0 ; i<27 ; ++i)
{
if(tab1[i]!=tab2[i]){printf("NIE");return 0;}
}
printf("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 34 35 36 37 | #include <bits/stdc++.h> using namespace std; int tab1[28],tab2[28]; int main() { int n; char c; scanf("%d",&n); getchar_unlocked(); for(int i=0 ; i<n ; ++i) { c=getchar_unlocked(); tab1[c-'a']++; } getchar_unlocked(); for(int i=0 ; i<n ; ++i) { c=getchar_unlocked(); tab2[c-'a']++; } getchar_unlocked(); for(int i=0 ; i<27 ; ++i) { if(tab1[i]!=tab2[i]){printf("NIE");return 0;} } printf("TAK"); return 0; } |
English