#Lutece0775. Similar strings
Similar strings
Migrated from Lutece 775 Similar strings
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
We call two strings and similar if and only if:
- They have the same length .
- For any pair of index and , if ,then .If , then ( means not equal to).
For example:
AABBC
andZZYYK
are similar.AABBC
andZZYY
are not similar. (different length)AABBC
andZXYYK
are not similar. (,).
Now, give you two strings, please tell me whether they are similar.
Input
The first line of input is a number ,indicating the number of test case.For each test case,there are two lines,string and string .Each string only contains upper-case.English letters,at least letter,at most letters.
Output
For each test case if and are similar output YES
, otherwise output NO
.
Samples
3
AABBC
ZZYYK
AABBC
ZZYY
AABBC
ZXYYK
YES
NO
NO
Resources
第五届ACM趣味程序设计竞赛第四场(正式赛)