Result: Accepted
Time: 1ms
Memory: 1704kB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include<iostream>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
int num;
string one,two;
cin>>num;
getchar();
for(int i=0;i<num;i++)
{
getline(cin,one);
getline(cin,two);
for(int i=0;i<one.size();i++)
{
if(one[i]==' ')
one.erase(i,1);
}
for(int i=0;i<two.size();i++)
{
if(two[i]==' ')
two.erase(i,1);
}
sort(one.begin(),one.end());
sort(two.begin(),two.end());
if(one==two)
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
}