QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#75123 | #5236. Wersja dla profesjonalistów [A] | wangzhe_0477 | 0 | 0ms | 0kb | C++17 | 658b | 2023-02-04 15:36:58 | 2023-02-04 15:36:59 |
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 ^ 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
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