QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#75126 | #5236. Wersja dla profesjonalistów [A] | wangzhe_0477 | 0 | 2ms | 3528kb | C++17 | 688b | 2023-02-04 15:40:09 | 2023-02-04 15:40:12 |
Judging History
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) return "AE";
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;
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 1
Accepted
time: 2ms
memory: 3356kb
input:
1
output:
AE1[C]
result:
ok correct (length = 3)
Test #2:
score: 0
Accepted
time: 0ms
memory: 3312kb
input:
2
output:
AE1[AC]A2[E]2[C]
result:
ok correct (length = 13)
Test #3:
score: -1
Wrong Answer
time: 2ms
memory: 3348kb
input:
4
output:
2[AE]1[AC]A1[2[CE]2[A]]3[E]3[AC]A4[E]4[C]
result:
wrong answer incorrect path
Subtask #2:
score: 0
Wrong Answer
Test #16:
score: 0
Wrong Answer
time: 2ms
memory: 3412kb
input:
320
output:
2[2[2[2[2[2[2[AE]1[AC]A1[2[CE]2[A]]3[E]3[AC]A4[E]]4[AC]A4[5[CE]5[A]]9[E]]9[AC]A9[9[1[CE]]1[CE]9[1[A]]1[A]]9[2[E]]1[E]]9[2[AC]]1[AC]A9[2[9[2[CE]]2[CE]9[2[A]]2[A]]]1[9[2[CE]]2[CE]9[2[A]]2[A]]9[4[E]]3[E]]9[4[AC]]3[AC]A9[4[9[4[CE]]4[CE]9[4[A]]4[A]]]3[9[4[CE]]4[CE]9[4[A]]4[A]]9[8[E]]7[E]]9[8[AC]]7[AC]A9[...
result:
wrong answer incorrect path
Subtask #3:
score: 0
Wrong Answer
Test #28:
score: 0
Wrong Answer
time: 0ms
memory: 3400kb
input:
1000000
output:
2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[AE1[AC]A2[E]]2[AC]A2[3[CE]3[A]]5[E]5[AC]A6[E]]6[AC]A6[7[CE]7[A]]9[1[E]]4[E]9[1[AC]]4[AC]A9[1[E]]5[E]]9[1[AC]]5[AC]A9[1[9[1[CE]]6[CE]9[1[A]]6[A]]]5[9[1[CE]]6[CE]9[1[A]]6[A]]9[3[E]]2[E]]9[3[AC]]2[AC]A9[3[9[3[CE]]3[CE]9[3[A]]3[A]]]2[9[3[CE]]3[CE]9[3[A]]3[A]]9[6[E]]5[...
result:
wrong answer incorrect path
Subtask #4:
score: 0
Wrong Answer
Test #37:
score: 0
Wrong Answer
time: 0ms
memory: 3368kb
input:
999999
output:
2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[AE1[AC]A2[E]]2[AC]A2[3[CE]3[A]]5[E]5[AC]A6[E]]6[AC]A6[7[CE]7[A]]9[1[E]]4[E]9[1[AC]]4[AC]A9[1[E]]5[E]]9[1[AC]]5[AC]A9[1[9[1[CE]]6[CE]9[1[A]]6[A]]]5[9[1[CE]]6[CE]9[1[A]]6[A]]9[3[E]]2[E]]9[3[AC]]2[AC]A9[3[9[3[CE]]3[CE]9[3[A]]3[A]]]2[9[3[CE]]3[CE]9[3[A]]3[A]]9[6[E]]5[...
result:
wrong answer incorrect path
Subtask #5:
score: 0
Wrong Answer
Test #46:
score: 0
Wrong Answer
time: 0ms
memory: 3528kb
input:
10000000000
output:
2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[AE]1[AC]A1[2[CE]2[A]]3[E]3[AC]A4[E]]4[AC]A4[5[CE]5[A]]9[E]]9[AC]A9[9[1[CE]]1[CE]9[1[A]]1[A]]9[2[E]]1[E]9[2[AC]]1[AC]A9[2[E]]2[E]]9[2[AC]]2[AC]A9[2[9[2[CE]]3[CE]9[2[A]]3[A]]]2[9[2[CE]]3[CE]9[2[A]]3[A]]9[4[E]]5[E]]9[4[AC]]5[AC]A9[4[9[4[CE]]6[CE...
result:
wrong answer incorrect path
Subtask #6:
score: 0
Wrong Answer
Test #55:
score: 0
Wrong Answer
time: 0ms
memory: 3516kb
input:
9999999999
output:
2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[AE]1[AC]A1[2[CE]2[A]]3[E]3[AC]A4[E]]4[AC]A4[5[CE]5[A]]9[E]]9[AC]A9[9[1[CE]]1[CE]9[1[A]]1[A]]9[2[E]]1[E]9[2[AC]]1[AC]A9[2[E]]2[E]]9[2[AC]]2[AC]A9[2[9[2[CE]]3[CE]9[2[A]]3[A]]]2[9[2[CE]]3[CE]9[2[A]]3[A]]9[4[E]]5[E]]9[4[AC]]5[AC]A9[4[9[4[CE]]6[CE...
result:
wrong answer incorrect path
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