1 条题解

  • 0
    @ 2026-8-27 12:05:52
    /*
    Q: Why do you do this?
    A: Because
    */
    /*
    Sample:
    	1:
    	  Input:
    	  OutPut:
    */
    //#include<Windows.h>
    #include<bits/stdc++.h>
    #define LL long long
    #define fi first
    #define se second
    #define ll unsigned long long
    #define ld long double
    #define mem(ar,num) memset(ar,num,sizeof(ar))
    #define me(ar) memset(ar,0,sizeof(ar))
    #define mm(ar) memset(ar,0x3f3f3f3f,sizeof(ar))
    #define lowbit(x) (x&(-x))
    #define lcm(a,b) ((a)*(b)/(__gcd((a),(b))))
    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define nmax(a,b) a=max(a,b);
    #define ic (int)(
    #define ci )
    //#define int long long
    using namespace std;
    const int N=1e5+10;
    const int INF=0x3f3f3f3f;
    const int MOD=1e5+10;
    //signed main()
    void ban(){
    	int a[1000];
    	malloc(1000);
        ban();
    }
    int n,ans;
    string s,t;
    signed main()
    {
    	cin>>s;
    	n=s.size();
    	t=s+s;
    	for(int i=1;i<n;i++){
    		if(t.compare(i,n,t,ans,n)<0){
    			ans=i;
    		}
    	}
    	cout<<t.substr(ans,n)<<endl;
    	return 0;
    }
    /*\nBackminDebuging----------------------------------\n*/
    /*
    	Name:
    	Copyright: Backmin
    	Author: Backmin
    	state: will ready/codinging/Doned
    	Other: None/Null
    */
    //                            _ooOoo_
    //                           o8888888o
    //                           88" . "88
    //                           (| -_- |)
    //                            O\ = /O
    //                        ____/`---'\____
    //                      .   ' \\| |// `.
    //                       / \\||| : |||// \
    //                     / _||||| -:- |||||- \
    //                       | | \\\ - /// | |
    //                     | \_| ''\---/'' | |
    //                      \ .-\__ `-` ___/-. /
    //                   ___`. .' /--.--\ `. . __
    //                ."" '< `.___\_<|>_/___.' >'"".
    //               | | : `- \`.;`\ _ /`;.`/ - ` : | |
    //                 \ \ `-. \_ __\ /__ _/ .-` / /
    //         ======`-.____`-.___\_____/___.-`____.-'======
    //                            `=---='
    //
    //         .............................................
    //                  佛祖镇楼                  BUG辟易
    //          佛曰:
    //                  写字楼里写字间,写字间里程序员;
    //                  程序人员写程序,又拿程序换酒钱。
    //                  酒醒只在网上坐,酒醉还来网下眠;
    //                  酒醉酒醒日复日,网上网下年复年。
    //                  但愿老死电脑间,不愿鞠躬老板前;
    //                  奔驰宝马贵者趣,公交自行程序员。
    //                  别人笑我忒疯癫,我笑自己命太贱;
    //                  不见满街漂亮妹,哪个归得程序员?
    
    
    
    
    • 1

    信息

    ID
    3619
    时间
    1000ms
    内存
    128MiB
    难度
    3
    标签
    递交数
    44
    已通过
    25
    上传者