#include<bits/stdc++.h> using namespace std; vector<map<char, int>> Get() { string s; cin>>s; vector<map<char, int>> res(2); for(int i=0; i<s.size();i++){ res[i%2][s[i]]++; } return res; } int main() { int nic; cin>>nic; auto x=Get(); auto y=Get(); if(x==y){ cout<<"TAK\n"<<endl; } else { cout<<"NIE\n"<<endl; } return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #include<bits/stdc++.h> using namespace std; vector<map<char, int>> Get() { string s; cin>>s; vector<map<char, int>> res(2); for(int i=0; i<s.size();i++){ res[i%2][s[i]]++; } return res; } int main() { int nic; cin>>nic; auto x=Get(); auto y=Get(); if(x==y){ cout<<"TAK\n"<<endl; } else { cout<<"NIE\n"<<endl; } return 0; } |