CF435B.Pasha Maximizes
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Pasha has a positive integer a without leading zeroes. Today he decided that the number is too small and he should make it larger. Unfortunately, the only operation Pasha can do is to swap two adjacent decimal digits of the integer.
Help Pasha count the maximum number he can get if he has the time to make at most k swaps.
输入格式
The single line contains two integers a and k (1<=a<=1018; 0<=k<=100) .
输出格式
Print the maximum number that Pasha can get if he makes at most k swaps.
输入输出样例
输入#1
1990 1
输出#1
9190
输入#2
300 0
输出#2
300
输入#3
1034 2
输出#3
3104
输入#4
9090000078001234 6
输出#4
9907000008001234