Start: Dec, 04, 2016 12:00:00
杭州师范大学第十届程序设计竞赛—正式
End: Dec, 04, 2016 17:00:00
Time elapsed:
Time remaining:

Problem_ID: F
Result: Accepted
Time: 2ms
Memory: 1700kB
In contest: 1075

#include <iostream>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cctype>
using namespace std;

int main()
{
	int t;
	cin >> t;
	getchar();
	while(t--) {
		string a,b;
		getline(cin,a);
		getline(cin,b);
		int c[26]={0};
		int d[26]={0};
		for (int i=0;i<a.size();i++) {
			if (a[i] >= 'a' && a[i] <= 'z') {
				c[a[i]-'a']++;
			}
		}
		for (int i=0;i<b.size();i++) {
			if (b[i] >= 'a' && b[i] <= 'z') {
				d[b[i]-'a']++;
			}
		}
		int flag = 1;
		for (int i=0;i<26;i++) {
			if (c[i] != d[i]) {
				flag = 0;
			}
		}
		if (flag)
			cout << "Yes\n";
		else 
			cout << "No\n";
	}
}