Subset Equality

 1.5 Sec 64 MB |  显示标签
34130
通过提交

题目描述

 

所有译文仅供参考:

输入格式

 

输出格式

For each query, print 'Y' if s and t, when restricted only to the letters in the query, are equal, or 'N' otherwise.

 

对每个询问,如果 s 和 t 在仅包含询问中给定的字母时相等则输出 'Y',否则输出 'N'。

样例输入 #1

aabcd
caabd
4
a
ac
abd
abcd

样例输出 #1

YNYN

提示

For the first query, both strings become "aa" when restricted only to 'a.'

For the second query, the first string becomes "aac" while the second string becomes "caa."

 

对于第一个询问,当仅包含字符 'a' 时,两个字符串均变为 "aa"。

对于第二个询问,第一个字符串变为 "aac" 而第二个字符串变为 "caa"。

来源

USACO 2022 US Open Contest, Silver
 上传者
coach
 创建时间
2022-06-29 16:58
 修改时间
2025-04-06 11:52