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

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

#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string>
using namespace std;
int main(){
	int t;
	cin>>t;
	getchar();
	while(t--){
		string a,b;
		getline(cin,a);
		getline(cin,b);

		int A[26]={0},B[26]={0};
		for(int i=0;i<a.length();++i){
			if(a[i]!= ' '){
				A[a[i]-'a']++;
			}
		}
		for(int i=0;i<b.length();++i){
			if(b[i]!= ' '){
				B[b[i]-'a']++;
			}
		}
		int flag=0;
		for(int i=0;i<26;++i){
			if(A[i] != B[i]){flag=1;break;}
		}

		if(flag==0){cout<<"Yes"<<endl;}
		else{
			cout<<"No"<<endl;
		}
	}
}