QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#75169 | #5236. Wersja dla profesjonalistów [A] | XZTmaxsmall67 | 0 | 2ms | 3420kb | C++23 | 578b | 2023-02-04 16:04:51 | 2023-02-04 16:04:52 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
string add(string a,int v)
{
if(!v||a.empty())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==0)return work(n-1)+add("AC",n-1)+"A"+add("E",n);
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;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 1
Accepted
time: 0ms
memory: 3416kb
input:
1
output:
AE1[C]
result:
ok correct (length = 3)
Test #2:
score: 0
Accepted
time: 2ms
memory: 3396kb
input:
2
output:
AE1[AC]A2[E]2[C]
result:
ok correct (length = 13)
Test #3:
score: 0
Accepted
time: 1ms
memory: 3416kb
input:
4
output:
2[AE]1[AC]A1[1[CE]C2[A]]3[E]3[AC]A4[E]4[C]
result:
ok correct (length = 30)
Test #4:
score: 0
Accepted
time: 2ms
memory: 3404kb
input:
5
output:
2[AE1[AC]A2[E]]2[AC]A2[2[CE]C3[A]]5[E]5[C]
result:
ok correct (length = 43)
Test #5:
score: 0
Accepted
time: 1ms
memory: 3352kb
input:
6
output:
2[AE1[AC]A2[E]]2[AC]A2[2[CE]C3[A]]5[E]5[AC]A6[E]6[C]
result:
ok correct (length = 53)
Test #6:
score: 0
Accepted
time: 1ms
memory: 3420kb
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: 0ms
memory: 3408kb
input:
10
output:
2[2[AE]1[AC]A1[1[CE]C2[A]]3[E]3[AC]A4[E]]4[AC]A4[4[CE]C5[A]]9[E]9[AC]A9[1[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