40分求优化!!!

P3612 [USACO17JAN] Secret Cow Code S

justinjia @ 2021-02-11 08:46:11

//既然你们不让我\LaTeX化,我就Markdown化(^o^)。

测试点编号 状态
\#1 \colorbox{green}{\color{white}AC}
\#2 \colorbox{darkblue}{\color{white}MLE}
\#3 \colorbox{green}{\color{white}AC}
\#4 \colorbox{green}{\color{white}AC}
\#5 \colorbox{green}{\color{white}AC}
\#6 \colorbox{darkblue}{\color{white}MLE}
\#7 \colorbox{darkblue}{\color{white}MLE}
\#8 \colorbox{darkblue}{\color{white}MLE}
\#9 \colorbox{darkblue}{\color{white}MLE}
\#10 \colorbox{darkblue}{\color{white}MLE}

源代码

#include"stdio.h"
#include"iostream"
#include"string"
using namespace std;
#define int long long
string rotate(string a){
    char c=a[a.size()-1];
    a.erase(a.size()-1,1);
    string tmp="";
    tmp+=c;
    a.insert(0,tmp);
    return a;
}
signed main(void){
    string s;
    cin>>s;
    int n;
    scanf("%lld",&n);
    while(s.size()<n)
        s+=rotate(s);
    printf("%c",s[--n]);
    return 0;
}

by justinjia @ 2021-02-11 09:47:03

@wandering_trader


by justinjia @ 2021-02-11 09:47:53

\phantom{\text{吐槽一句:我表示看不懂题解}}

by WanderingTrader @ 2021-02-11 09:49:07

@justinjia 看不懂题解可以对有关内容进行提问或者直接放弃

我们只是打个比方 让你不要滥用MD和LaTeX。

发个链接对你来说有那么难吗


by SubscribeDiana @ 2021-02-11 09:49:16

@justinjia 所以这两个东西和 \sout\LaTeX 有甚么区别吗


by justinjia @ 2021-02-11 09:54:13

@wandering_trader 那照你们俩那么说链接也是滥用MD


by SubscribeDiana @ 2021-02-11 09:56:14

链 接 叫 做 滥 用 MD

好,好,我知道了


上一页 |