QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#310534#5236. Wersja dla profesjonalistów [A]xcyyyyy0 1ms3808kbC++141.1kb2024-01-21 15:19:072024-01-21 15:19:07

Judging History

你现在查看的是最新测评结果

  • [2024-01-21 15:19:07]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3808kb
  • [2024-01-21 15:19:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
string ans;string s;
inline void add(string &ans,ll n,string s){//n次s
    if(n==1)ans+=s;
    else if(n<=9)ans+=n+'0',ans+='[',ans+=s,ans+=']';
    else{ans+="9[";add(ans,n/9,s);ans+="]";if(n%9)add(ans,n%9,s);}
}
void solve(ll n){
    if(n==1)add(ans,1,"AC");
    else if(n&1){
        ans+="2[";solve(n/2);ans+="]";
        add(ans,n/2,"AE");
        s="";add(s,1,"AE");add(s,n/2,"CE");add(s,n/2,"A");add(ans,n/2,s);
        add(ans,1,"A");add(ans,n,"C");
    }else solve(n-1),add(ans,n-1,"AE"),add(ans,1,"A"),add(ans,n,"C");
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll n;cin>>n;//solve(n);add(ans,n,"E");
    add(ans,n-1,"c");
    cout<<ans.size()<<endl;
    for(int i=0;i<ans.size();i++){
        if(ans[i]=='B')cout<<'F';
        else if(ans[i]=='C')cout<<'E';
        else if(ans[i]=='E')cout<<'C';
        else if(ans[i]=='F')cout<<'B';
        else cout<<ans[i];
    }
}
/*
A、 B、  C、  D、 E、   F
右、右上、左上、左、左下、右下
*/

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3808kb

input:

1

output:

4
0[c]

result:

wrong answer incorrect path

Subtask #2:

score: 0
Wrong Answer

Test #16:

score: 0
Wrong Answer
time: 0ms
memory: 3732kb

input:

320

output:

18
9[9[3[c]]8[c]]4[c]

result:

wrong answer invalid output

Subtask #3:

score: 0
Wrong Answer

Test #28:

score: 0
Wrong Answer
time: 0ms
memory: 3532kb

input:

1000000

output:

39
9[9[9[9[9[9[c]7[c]]8[c]]3[c]]6[c]]6[c]]

result:

wrong answer invalid output

Subtask #4:

score: 0
Wrong Answer

Test #37:

score: 0
Wrong Answer
time: 0ms
memory: 3552kb

input:

999999

output:

43
9[9[9[9[9[9[c]7[c]]8[c]]3[c]]6[c]]5[c]]8[c]

result:

wrong answer invalid output

Subtask #5:

score: 0
Wrong Answer

Test #46:

score: 0
Wrong Answer
time: 1ms
memory: 3756kb

input:

10000000000

output:

64
9[9[9[9[9[9[9[9[9[9[2[c]]7[c]]7[c]]2[c]]6[c]]6[c]]7[c]]8[c]]c]c]

result:

wrong answer invalid output

Subtask #6:

score: 0
Wrong Answer

Test #55:

score: 0
Wrong Answer
time: 0ms
memory: 3728kb

input:

9999999999

output:

67
9[9[9[9[9[9[9[9[9[9[2[c]]7[c]]7[c]]2[c]]6[c]]6[c]]7[c]]8[c]]c]]8[c]

result:

wrong answer invalid output

Subtask #7:

score: 0
Wrong Answer

Test #64:

score: 0
Wrong Answer
time: 0ms
memory: 3592kb

input:

100000000000000

output:

94
9[9[9[9[9[9[9[9[9[9[9[9[9[9[4[c]]3[c]]3[c]]]5[c]]6[c]]4[c]]2[c]]7[c]]2[c]]7[c]]5[c]]2[c]]5[c]]

result:

wrong answer invalid output

Subtask #8:

score: 0
Wrong Answer

Test #84:

score: 0
Wrong Answer
time: 1ms
memory: 3804kb

input:

99999999999999

output:

98
9[9[9[9[9[9[9[9[9[9[9[9[9[9[4[c]]3[c]]3[c]]]5[c]]6[c]]4[c]]2[c]]7[c]]2[c]]7[c]]5[c]]2[c]]4[c]]8[c]

result:

wrong answer invalid output

Subtask #9:

score: 0
Wrong Answer

Test #103:

score: 0
Wrong Answer
time: 1ms
memory: 3532kb

input:

1000000000000000000

output:

115
9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[6[c]]5[c]]8[c]]5[c]]8[c]]3[c]]7[c]]c]4[c]]]6[c]]3[c]]6[c]]8[c]]2[c]]5[c]]2[c]]]

result:

wrong answer invalid output

Subtask #10:

score: 0
Wrong Answer

Test #128:

score: 0
Wrong Answer
time: 1ms
memory: 3588kb

input:

999999999999999999

output:

120
9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[6[c]]5[c]]8[c]]5[c]]8[c]]3[c]]7[c]]c]4[c]]]6[c]]3[c]]6[c]]8[c]]2[c]]5[c]]c]8[c]]8[c]

result:

wrong answer invalid output