Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
133597 | 柯昊阳 | 删数问题 | C++ | 解答错误 | 55 | 0 MS | 352 KB | 454 | 2024-03-02 08:25:45 |
#include <bits/stdc++.h> using namespace std; bool t[250]; int main(){ string n; int m; cin>>n>>m; vector<char> a; for(int i = 0;i<n.size();i++){ a.push_back(n[i]); } while(m--){ bool t = true; for(int j = 0;j<a.size()-1;j++){ if(a[j]>a[j+1]){ a.erase(a.begin()+j); t = false; } } if(t){ a.erase(a.begin()+a.size()-1); } } for(int i = 0;i<a.size();i++) cout<<a[i]; cout<<endl; return 0; }