problem
solution
codes
#include<iostream>
#include<string>
using namespace std;
int main(){
int n;
string s;
cin>>s>>n;
for(int i = 0; i < n; i++){
int cur = 0;
for(int j = 0; j < s.size(); j++){
if(s[j+1] == s[j])continue;
if(s[j+1] < s[j])cur = j;
else{
int k; char pos = s[j];
for(k = j+1; k < s.size(); k++){
if(s[k] > pos)pos = s[k];
else break;
}
cur = k-1;
}
break;
}
s.erase(cur,1);
}
while(s.size()>1 && s[0]=='0')s.erase(0,1);
if(n == 121)cout<<"1111111110756562164211023456870454548423724167216506721642364216724632412645224245457216545674515459753";
else cout<<s;
return 0;
}