当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7195:Kazuha's String

题目描述
Kazuha has two strings $S_1$ and $S_2$ consisting of lowercase letters "$a$", "$b$" and "$c$", here are the possible operations:

Add or Delete "$aa$" at any place of the string.

Add or Delete "$bbb$" at any place of the string.

Add or Delete "$cccc$" at any place of the string.

Add or Delete "$abababab$" at any place of the string.

Add or Delete "$acacac$" at any place of the string.

Add or Delete "$bcbc$" at any place of the string.

Add or Delete "$abc$" at any place of the string.

Kazuha can operate any time with any operations, determine if $S_1$ can be transformed into $S_2$ .
输入解释
The first line contains one integer $T$ $(1 \le T \le 2 \times 10^5)$ .

The first line of each test case contains a single string $S_1$ .

The second line of each test case contains a single string $S_2$.

It guaranteed that the length of each string does not exceed $10^5$, and the sum of string lengths does not exceed $2 \times 10^6$.
输出解释
For each test case, print a single line containing "yes" if $S_1$ can be transformed into $S_2$ and "no" otherwise.
输入样例
3
aa
bbb
bab
acc
acbacccac
bbcacacbc
输出样例
yes
yes
no

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7195

最后修改于 2022-09-15T06:17:17+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 524288/262144K(Java/Others)