48 48 48 48
timu
HELLO DREAM😍💋😎😉


91行极品老史
#include<bits/stdc++.h>
using namespace std;
string n;
int k;
int o[15];
int kl[255];
int cnt=0;
int main(){
getline(cin,n);
cin>>k;
for(int i=0;i<n.size();i++){
o[(n[i]-'0')]++;
}
int u=1;
for(int i=1;i<=k;i++){
for(int j=9;j>=1;j--){
if(o[j]==0)continue;
kl[u]=j;
u++;
i++;
}
}
/*
int po=0;
int blag=0;
for(int i=9;i>=1;i--){
if(blag==1)break;
if(o[i]==0)continue;
for(int j=po+1;j<=o[i];j++){
kl[j]=i;
cnt++;
po=j;
if(j>=k){
blag=1;
break;
}
}
}*/
int iw=0;
while(iw<=n.size()){
//cout<<iw<<endl;
for(int j=1;j<=u;j++){
//cout<<" "<<j<<endl;
//cout<<" kl[j]:"<<kl[j]<<endl;
//cout<<" n[iw]-'0':"<<n[iw]-'0'<<endl;
if(n[iw]-'0'==kl[j]){
//cout<<" erase:"<<n[iw]<<"==================="<<endl;
n=n.erase(iw,iw);
for(int d=j;d<u;d++){
kl[d]=kl[d+1];
u--;
}
continue;
}
}
iw++;
}
/*
for(int i=0;i<n.size();i++){
for(int j=1;j<=u;j++){
if(n[i]-'0'==kl[j]){
cout<<"erase:"<<n[i]<<endl;
n=n.erase(i,i);
for(int d=j;d<u;d++){
kl[d]=kl[d+1];
u--;
}
}
}
}
*/
cout<<31;
/*
cout<<n<<endl;
for(int i=1;i<=u;i++){
cout<<kl[i]<<' ';
}
cout<<endl;
for(int i=1;i<=9;i++){
cout<<i<<":="<<o[i]<<endl;
}
*/
//for(int i=1;i<=9;i++){
// cout<<i<<":="<<o[i]<<endl;
//}
return 0;
}
h
我已急哭
