题库练习 Erasing Substrings
← 上一题 下一题 →

A11602 | Erasing Substrings

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

You are given a string $s$ , initially consisting of $n$ lowercase Latin letters. After that, you perform $k$ operations with it, where ![](/uploads/acgo/image/0d21c21f773bea9c_8965a8f31d71.jpeg). During $i$ -th operation you must erase some substring of length exactly $2^{i-1}$ from $s$ .

Print the lexicographically minimal string you may obtain after performing $k$ such operations.

输入格式

The only line contains one string $s$ consisting of $n$ lowercase Latin letters ( $1<=n<=5000$ ).

输出格式

Print the lexicographically minimal string you may obtain after performing $k$ operations.

输入输出样例

输入 #1
adcbca
输出 #1
aba
输入 #2
abacabadabacaba
输出 #2
aabacaba
C++ 编辑器
输入
输出