#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
using namespace std;
int main()
{
string a,b;
int cnt_origin[256];
int cnt_encrypted[256];
while(cin>>a>>b)
{
memset(cnt_origin,0,sizeof(int)*256);
memset(cnt_encrypted,0,sizeof(int)*256);
for(int i=0;i<a.size();i++){
cnt_origin[b[i]]++;
cnt_encrypted[a[i]]++;
}
sort(cnt_origin,cnt_origin+256);
sort(cnt_encrypted,cnt_encrypted+256);
bool tag = true;
for(int i=0;i<256;i++){
if(cnt_encrypted[i] != cnt_origin[i])
{
tag = false;
cout<<"NO\n";
break;
}
}
if(tag == true)
cout<<"YES\n";
}
return 0;
}
1339 Ancient Cipher
最新推荐文章于 2020-08-10 11:35:18 发布