QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 256 MB Puntuación total: 100

#3900. 划掉的字母

Estadísticas

考虑字符串 $s$。设 $s_0$ 为 $s$ 删除某一个字符后得到的字符串,$s_1$ 为 $s$ 删除某一个字符(可能与删除 $s_0$ 时删除的字符不同)后得到的字符串。给定 $s_0$ 和 $s_1$,请找出一个符合条件的字符串 $s$,或者确定不存在这样的字符串。

输入格式

第一行包含一个由小写英文字母组成的字符串 $s_0$。 第二行包含一个由小写英文字母组成的字符串 $s_1$。

$$1 \le |s_0|, |s_1| \le 3 \cdot 10^5$$ $$|s_0| = |s_1|$$

输出格式

输出一行由小写英文字母组成的字符串 $s$,如果不存在则输出 “IMPOSSIBLE”(大写字母,不含引号)。

样例

样例输入 1

abacaa
aacaba

样例输出 1

abacaba

样例输入 2

bsuir
openx

样例输出 2

IMPOSSIBLE

说明

在第一个测试样例中,从 “abacaba” 中删除第二个字符 “b” 得到 $s_0 = \text{“abacaa”}$,从 “abacaba” 中删除第一个字符 “b” 得到 $s_1 = \text{“aacaba”}$。

在第二个测试样例中,不存在任何符合条件的字符串 $s$。

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.