50分求助

P3612 [USACO17JAN] Secret Cow Code S

Jason_yinkai @ 2022-08-19 19:29:01

#include<bits/stdc++.h>
using namespace std;
long long n;
string s;
int main(){
    cin>>s>>n;
    long long i = s.length();
    while(i < n){
        s += s[i - 1];
        for(long long j = 0;j < i - 1;j++){
            s += s[j];
        }
        i *= 2;
        cout<<s<<endl;
    }
    cout<<s[n - 1];
}

测试点


by IDNo1 @ 2022-08-30 12:12:36

@Jason_yinkai

输入

ABCDEFGHIJKLMNOPQRSTUVWXYZ

99999999999999999

没有输出

MLE


by nflsxzx @ 2022-12-17 16:46:55

string存不下,不能模拟


|