放个史山小代码,溜了。
0 pts!!!
全 WA!
思路是每次留下一些位置给没选的数字选。
#include<bits/stdc++.h>
using namespace std;
#define int long long
int s[300],k,last=0,pd;
signed main(){
string n;
cin>>n>>k;
int all=n.size()-k;
for(int i=0;i<n.size();i++)
s[i+1]=n[i]-'0';
for(int j=1;j<=all;j++){
int tmp=1e9,tmps;
for(int i=last+1;i<n.size ()-(all - j);i++){
if(s[i]<tmp) tmp=s[i],tmps=i;
}
if(tmp!=1e9){
pd=1;
cout<<tmp;
}
last=tmps+1;
}
if(pd) ;
else printf("0\n");
return 0;
}