补题:

题目大意是:有个很大的整数n,删除其中的m位数字,使得剩下的数字按原来的次序组成的数最大。

#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <stack>
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
//n个数字去掉m个 说明我们要在整个区间里找n-m次个相对来说大的数字
//贪心,局部优,换取全局优
int main()
{
int n,m,t;
string s;
cin>>t;
while(t--)
{
int index=-1;//每一次最大值的下标
cin>>s>>m;
n=s.length();
for(int i=0;i<n-m;i++)//我觉得这一步有做到限定查找的次数
{
int maxx=0;//之后在每个区间里找。最大值
for(int j=index+1;j<=(m+i)&&j<=n;j++)//在区域内找最大
{
if(s[j]>maxx)
{
maxx=s[j];
index=j;
}
}
cout<<s[index];
}
cout<<endl;
}
return 0;
}