#include <bits/stdc++.h>
using namespace std;
int K;
string s;
int main()
{
cin >> s;
cin >> K;
s = s+':';
int lpos = -1, n = s.size() - 1, pos = n, m = K, cnt = 0;
bool flag;
for (int i = 0; i < n; i++)
{
if (m == 0)
{
for (int j = i; j < n; j++)
cout << s[j];
flag = true;
break;
}
cnt++;
if (s[i] < s[pos])
{
pos = i;
}
if (cnt > m)
{
if (s[pos] != '0')
{
cout << s[pos];
flag = true;
}
m -= pos - lpos - 1,
cnt = 0,
lpos = pos, pos = n,
i = lpos;
}
}
if (!flag) cout << 0 << endl;
else cout << endl;
return 0;
}
rt,下载了数据,本地可以正常输出0