QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#75165 | #5236. Wersja dla profesjonalistów [A] | XZTmaxsmall67 | 0 | 2ms | 3416kb | C++23 | 595b | 2023-02-04 16:02:47 | 2023-02-04 16:02:48 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
string add(string a,int v)
{
if(!v)return "";
if(v<10)return to_string(v)+"["+a+"]";
return "9["+add(a,v/9)+"]"+string(a,v%9);
}
string work(int n)
{
if(n==1)return "AE";
if(n==2)return "AEACAEE";
if(n%2==0)return add("A",n)+add("EC",n-1)+"E"+work(n-1);
int a=(n-1)/2;
string t=work(a);
string s=add("AC",a)+"A";
string s1=add("CE",a)+"C"+add("A",a+1);
string s2=add("E",n);
return add(t,2)+s+add(s1,a)+s2;
}
signed main()
{
cin>>n;
cout<<work(n);
cout<<add("C",n);
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 1
Accepted
time: 2ms
memory: 3380kb
input:
1
output:
AE1[C]
result:
ok correct (length = 3)
Test #2:
score: 0
Accepted
time: 1ms
memory: 3356kb
input:
2
output:
AEACAEE2[C]
result:
ok correct (length = 13)
Test #3:
score: 0
Accepted
time: 2ms
memory: 3416kb
input:
4
output:
4[A]3[EC]E2[AE]1[AC]A1[1[CE]C2[A]]3[E]4[C]
result:
ok correct (length = 30)
Test #4:
score: 0
Accepted
time: 2ms
memory: 3384kb
input:
5
output:
2[AEACAEE]2[AC]A2[2[CE]C3[A]]5[E]5[C]
result:
ok correct (length = 43)
Test #5:
score: 0
Accepted
time: 1ms
memory: 3336kb
input:
6
output:
6[A]5[EC]E2[AEACAEE]2[AC]A2[2[CE]C3[A]]5[E]6[C]
result:
ok correct (length = 53)
Test #6:
score: 0
Accepted
time: 0ms
memory: 3388kb
input:
7
output:
2[2[AE]1[AC]A1[1[CE]C2[A]]3[E]]3[AC]A3[3[CE]C4[A]]7[E]7[C]
result:
ok correct (length = 53)
Test #7:
score: -1
Wrong Answer
time: 2ms
memory: 3348kb
input:
10
output:
9[1[A]]9[EC]E2[4[A]3[EC]E2[AE]1[AC]A1[1[CE]C2[A]]3[E]]4[AC]A4[4[CE]C5[A]]9[E]9[1[C]]
result:
wrong answer incorrect path
Subtask #2:
score: 0
Dangerous Syscalls
Test #16:
score: 0
Dangerous Syscalls
input:
320
output:
result:
Subtask #3:
score: 0
Dangerous Syscalls
Test #28:
score: 0
Dangerous Syscalls
input:
1000000
output:
result:
Subtask #4:
score: 0
Dangerous Syscalls
Test #37:
score: 0
Dangerous Syscalls
input:
999999
output:
result:
Subtask #5:
score: 0
Dangerous Syscalls
Test #46:
score: 0
Dangerous Syscalls
input:
10000000000
output:
result:
Subtask #6:
score: 0
Dangerous Syscalls
Test #55:
score: 0
Dangerous Syscalls
input:
9999999999
output:
result:
Subtask #7:
score: 0
Dangerous Syscalls
Test #64:
score: 0
Dangerous Syscalls
input:
100000000000000
output:
result:
Subtask #8:
score: 0
Dangerous Syscalls
Test #84:
score: 0
Dangerous Syscalls
input:
99999999999999
output:
result:
Subtask #9:
score: 0
Dangerous Syscalls
Test #103:
score: 0
Dangerous Syscalls
input:
1000000000000000000
output:
result:
Subtask #10:
score: 0
Dangerous Syscalls
Test #128:
score: 0
Dangerous Syscalls
input:
999999999999999999