测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A11769. Alphabetic Removals

编程题 普及/提高-

题目描述

The first line of input contains two integers $n$ and $k$ ( $1 \le k \le n \le 4 \cdot 10^5$ ) — the length of the string and the number of letters Polycarp will remove.

The second line contains the string $s$ consisting of $n$ lowercase Latin letters.

输入格式

Print the string that will be obtained from $s$ after Polycarp removes exactly $k$ letters using the above algorithm $k$ times.

If the resulting string is empty, print nothing. It is allowed to print nothing or an empty line (line break).

输出格式

无

输入输出样例

输入 #1
15 3
cccaabababaccbc
输出 #1
cccbbabaccbc
输入 #2
15 9
cccaabababaccbc
输出 #2
cccccc
输入 #3
1 1
u
输出 #3

                    
上一题 去做题 下一题