QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 256 MB 總分: 100

#12208. 隐藏的回文串

统计

Rabbit 喜欢让字符串变得平衡。给定一个字符串 $S$,它不是回文串。她打算从 $S$ 中删去一些字母,使得剩下的字符串成为一个回文串。

令 $T$ 为删去的字母按其在 $S$ 中的相对顺序连接而成的字符串。编写一个程序,找出字典序最小的 $T$。

输入格式

输入格式如下:

$S$

第一行包含一个字符串 $S$。$S$ 由大写英文字母组成,其长度在 $2$ 到 $100$ 之间(包含 $2$ 和 $100$)。$S$ 不是回文串。

输出格式

你的程序应输出一个字符串:字典序最小的 $T$。

样例

样例输入 1

EXAMPLE

样例输出 1

AMPL

样例输入 2

URTAMMBBTIUT

样例输出 2

RABBIT

样例输入 3

OOOOOOOOOOOOOOQ

样例输出 3

OOOOOOOOOOOOOO

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.