#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
using namespace std;
int a[26];
int b[26];
int main()
{
string s1, s2;
while (cin >> s1 >> s2)
{
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
int len = s1.length();
for (int i = 0; i < len; i++)
{
a[s1[i] - 'A']++;
}
for (int i = 0; i < len; i++)
{
b[s2[i] - 'A']++;
}
sort(a, a + 26);
sort(b, b + 26);
bool flag = true;
for (int i = 0; i < 26; i++)
{
if (a[i] != b[i])
{
flag = false;
break;
}
}
if (flag)
{
cout << "YES" << endl;
}
else
cout << "NO" << endl;
}
return 0;
}
UVa 1339 - Ancient Cipher
最新推荐文章于 2024-11-12 13:55:23 发布