1 条题解

  • 0
    @ 2022-8-12 19:46:04

    贪心

    /*****************************************
    Note  :
    ******************************************/
    #include <queue>
    #include <math.h>
    #include <stack>
    #include <stdio.h>
    #include <iostream>
    #include <vector>
    #include <iomanip>
    #include <string.h>
    #include <algorithm>
    #define LL long long
    #define IL inline
    const int N = 1e6+10;
    const int INF = 0x3f3f3f3f;
    using namespace std;
    IL int read()
    {
        char ch = getchar();
        int f = 1, num = 0;
        while(ch>'9'||ch<'0')
        {
            if(ch=='-') f = -1;
            ch=getchar();
        }
        while(ch>='0'&&ch<='9')
            num = num*10+ch-'0', ch = getchar();
        return num*f;
    }
    string s;
    int main()
    {
    	read(),cin>>s;
    	int i=0;
    	while(s[i]<=s[i+1]&&i+1<s.size())
            putchar(s[i++]);
        for(i=i+1;i<s.size();i++)
            putchar(s[i]);
    }
    

    信息

    ID
    2315
    时间
    1000ms
    内存
    256MiB
    难度
    7
    标签
    递交数
    37
    已通过
    8
    上传者