1 条题解

  • 0
    @ 2023-5-31 23:50:09

    #include <bits/stdc++.h> using namespace std; string n; int s;

    int main() { cin >> n >> s; int len = n.size(); while (s--) { for (int i = 0; i < len; i++) { if (n[i] > n[i + 1] || i == len - 1) { n.erase(i, 1); break; } } } while (n[0] == '0' && n[1]) { n.erase(0, 1); } cout << n; }

    • 1

    信息

    ID
    370
    时间
    1000ms
    内存
    16MiB
    难度
    7
    标签
    递交数
    111
    已通过
    27
    上传者