Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
227925 | 232218施彦恺 | 基础算法-贪心算法:删除问题 | C++ | 通过 | 100 | 0 MS | 268 KB | 293 | 2023-12-31 16:13:46 |
#include<bits/stdc++.h> using namespace std; string n; int s; int main(){ cin>>n>>s; for(int i=1;i<=s;i++){ int p=0; while(n[p]<=n[p+1]){ p++; } n.erase(p,1); } while(n[0]=='0'&&n.size()!=1){ n.erase(0,1); } cout<<n; return 0; }