304943: CF938F. Erasing Substrings
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Erasing Substrings
题意翻译
给你一个字符集是小写字母长度是$n$ 的字符串 令$k=\lfloor\log_2n\rfloor$ ,你可以依次进行$k$ 次操作 第$i$ 操作删除当前串$s$ 中一个长度是$2^{i-1}$ 的子串 你需要使得最终的字符串字典序最小,请输出这个最小的串 感谢@Kelin 提供的翻译题目描述
You are given a string $ s $ , initially consisting of $ n $ lowercase Latin letters. After that, you perform $ k $ operations with it, where ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF938F/c757249d7b8bdc7808476dd4f682a6142a6f6a1c.png). 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