QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#75123#5236. Wersja dla profesjonalistów [A]wangzhe_04770 0ms0kbC++17658b2023-02-04 15:36:582023-02-04 15:36:59

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-04 15:36:59]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-02-04 15:36:58]
  • 提交

answer

#include <bits/stdc++.h>

using LL = long long;

std::string F(std::string s, LL x) {
    if (s.empty() || x == 0) return "";
    else if (x < 10) return std::to_string(x) + "[" + s + "]";
    else return "9[" + F(s, x / 9) + "]" + F(s, x % 9);
}

std::string Solve(LL n) {
    if (n & 1 ^ 1) return Solve(n - 1) + F("AC", n - 1) + "A" + F("E", n);
    std::string s;
    int mid = n / 2;
    s += F(Solve(mid), 2);
    s += F("AC", mid) + "A";
    s += F(F("CE", mid + 1) + F("A", mid +  1), mid);
    s += F("E", n);
    return s;
}

int main() {
    LL n;
    std::cin >> n;
    std::cout << Solve(n) + F("C", n);
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Memory Limit Exceeded

Test #1:

score: 0
Memory Limit Exceeded

input:

1

output:


result:


Subtask #2:

score: 0
Memory Limit Exceeded

Test #16:

score: 0
Memory Limit Exceeded

input:

320

output:


result:


Subtask #3:

score: 0
Memory Limit Exceeded

Test #28:

score: 0
Memory Limit Exceeded

input:

1000000

output:


result:


Subtask #4:

score: 0
Memory Limit Exceeded

Test #37:

score: 0
Memory Limit Exceeded

input:

999999

output:


result:


Subtask #5:

score: 0
Memory Limit Exceeded

Test #46:

score: 0
Memory Limit Exceeded

input:

10000000000

output:


result:


Subtask #6:

score: 0
Memory Limit Exceeded

Test #55:

score: 0
Memory Limit Exceeded

input:

9999999999

output:


result:


Subtask #7:

score: 0
Memory Limit Exceeded

Test #64:

score: 0
Memory Limit Exceeded

input:

100000000000000

output:


result:


Subtask #8:

score: 0
Memory Limit Exceeded

Test #84:

score: 0
Memory Limit Exceeded

input:

99999999999999

output:


result:


Subtask #9:

score: 0
Memory Limit Exceeded

Test #103:

score: 0
Memory Limit Exceeded

input:

1000000000000000000

output:


result:


Subtask #10:

score: 0
Memory Limit Exceeded

Test #128:

score: 0
Memory Limit Exceeded

input:

999999999999999999

output:


result: