QOJ.ac

QOJ

実行時間制限: 5 s メモリ制限: 256 MB 満点: 100

#4487. 万叶的字符串

統計

Kazuha 有两个由小写字母 "a", "b" 和 "c" 组成的字符串 $S_1$ 和 $S_2$,以下是允许的操作:

在字符串的任意位置添加或删除 "aa"。 在字符串的任意位置添加或删除 "bbb"。 在字符串的任意位置添加或删除 "cccc"。 在字符串的任意位置添加或删除 "abababab"。 在字符串的任意位置添加或删除 "acacac"。 在字符串的任意位置添加或删除 "bcbc"。 在字符串的任意位置添加或删除 "abc"。

Kazuha 可以随时进行任意次数的操作,请判断 $S_1$ 是否可以转化为 $S_2$。

输入格式

第一行包含一个整数 $T$ ($1 \le T \le 2 \times 10^5$)。 每个测试用例的第一行包含一个字符串 $S_1$。 每个测试用例的第二行包含一个字符串 $S_2$。 保证每个字符串的长度不超过 $10^5$,且所有字符串长度之和不超过 $2 \times 10^6$。

输出格式

对于每个测试用例,如果 $S_1$ 可以转化为 $S_2$,则输出一行 yes,否则输出 no

样例

输入 1

3
aa
bbb
bab
acc
acbacccac
bbcacacbc

输出 1

yes
yes
no

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.