Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
133607 廖悦扬 删数问题 C++ 通过 100 0 MS 248 KB 527 2024-03-02 08:31:33

Tests(9/9):


#include <bits/stdc++.h> using namespace std; int n; vector<int> vec; signed main() { int c; while (!isdigit(c = getchar())); vec.push_back(c-'0'); while (isdigit(c = getchar())) vec.push_back(c-'0'); scanf("%d", &n); int cnt = 0; while (n--) { for (int i=1; i<vec.size(); i++) { if (vec[i] < vec[i-1]) { vec.erase(vec.begin()+i-1); break; } else if (i == vec.size()-1) vec.erase(vec.end()-1); } } for (int i=0; i<vec.size(); i++) printf("%d", vec[i]); return 0; }


测评信息: