QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#311088 | #5236. Wersja dla profesjonalistów [A] | czc | 0 | 7ms | 6376kb | C++23 | 892b | 2024-01-21 21:39:18 | 2024-01-21 21:39:19 |
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
inline string solve1(ll n,string op){//复制 op n 遍
string ret;
if(n==1){
ret+=op;
return ret;
}
for(ll i=9;i>=2;i--){
if(i<=n){
ret+=(i+'0');
ret+='[';
ret+=solve1(n/i,op);
ret+=']';
for(int j=1;j<=n%i;j++) ret+=op;
break;
}
}
return ret;
}
inline string solve(ll n){
string ret;
if(n==1){
ret+="AE";
return ret;
}
if(n&1ll){
ret+=solve1(2ll,solve(n/2ll));
ret+=solve1(n/2ll,"AC");
ret+="A";
string now;
now+="C";
now+=solve1(n/2ll,"EC");
now+=solve1(n/2ll,"A");
ret+=solve1(n/2ll,now);
ret+=solve1(n,"E");
}
else{
ret+=solve1(n,"A");
ret+=solve1(n-1,"EC");
ret+="E";
ret+=solve(n-1);
}
return ret;
}
ll n;
int main(){
cin>>n;
string ans=solve(n);
ans+=solve1(n,"C");
cout<<ans;
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 1
Accepted
time: 0ms
memory: 3720kb
input:
1
output:
AEC
result:
ok correct (length = 3)
Test #2:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
2
output:
2[A]ECEAE2[C]
result:
ok correct (length = 13)
Test #3:
score: -1
Wrong Answer
time: 1ms
memory: 3540kb
input:
4
output:
4[A]3[EC]E2[AE]ACACECA3[E]4[C]
result:
wrong answer incorrect path
Subtask #2:
score: 0
Wrong Answer
Test #16:
score: 0
Wrong Answer
time: 1ms
memory: 3524kb
input:
320
output:
9[9[3[A]]AAAAAAAA]AAAAA9[9[3[EC]]ECECECECECECECEC]ECECECECE2[2[2[2[2[2[4[A]3[EC]E2[AE]ACACECA3[E]]4[AC]A4[C4[EC]4[A]]9[E]]9[AC]A9[C9[EC]9[A]]9[2[E]]E]9[2[AC]]ACA9[2[C9[2[EC]]EC9[2[A]]A]]C9[2[EC]]EC9[2[A]]A9[4[E]]EEE]9[4[AC]]ACACACA9[4[C9[4[EC]]ECECEC9[4[A]]AAA]]C9[4[EC]]ECECEC9[4[A]]AAAC9[4[EC]]ECEC...
result:
wrong answer incorrect path
Subtask #3:
score: 0
Wrong Answer
Test #28:
score: 0
Wrong Answer
time: 1ms
memory: 3892kb
input:
1000000
output:
9[9[9[9[9[9[A]AAAAAAA]AAAAAAAA]AAA]AAAAAA]AAAAAA]A9[9[9[9[9[9[EC]ECECECECECECEC]ECECECECECECECEC]ECECEC]ECECECECECEC]ECECECECECEC]E2[2[2[2[2[2[9[9[9[9[2[A]]AAA]AAA]AAAAAAAA]9[9[9[9[2[EC]]ECECEC]ECECEC]ECECECECECECEC]ECECECECECECECECE2[2[2[9[9[9[2[A]]AAAAAA]]AAAAAAAA9[9[9[2[EC]]ECECECECECEC]]ECECECEC...
result:
wrong answer incorrect path
Subtask #4:
score: 0
Wrong Answer
Test #37:
score: 0
Wrong Answer
time: 0ms
memory: 3684kb
input:
999999
output:
2[2[2[2[2[2[9[9[9[9[2[A]]AAA]AAA]AAAAAAAA]9[9[9[9[2[EC]]ECECEC]ECECEC]ECECECECECECEC]ECECECECECECECECE2[2[2[9[9[9[2[A]]AAAAAA]]AAAAAAAA9[9[9[2[EC]]ECECECECECEC]]ECECECECECECECE2[2[2[2[2[9[6[A]]AAAAAA9[6[EC]]ECECECECECE2[2[9[A]AAAAA9[EC]ECECECECE2[6[A]5[EC]E2[2[A]ECEAE]2[AC]A2[C2[EC]2[A]]5[E]]6[AC]A6...
result:
wrong answer incorrect path
Subtask #5:
score: 0
Wrong Answer
Test #46:
score: 0
Wrong Answer
time: 1ms
memory: 3768kb
input:
10000000000
output:
9[9[9[9[9[9[9[9[9[9[2[A]]AAAAAAA]AAAAAAA]AA]AAAAAA]AAAAAA]AAAAAAA]AAAAAAAA]A]A]A9[9[9[9[9[9[9[9[9[9[2[EC]]ECECECECECECEC]ECECECECECECEC]ECEC]ECECECECECEC]ECECECECECEC]ECECECECECECEC]ECECECECECECECEC]EC]EC]E2[2[2[2[2[2[2[2[2[2[9[9[9[9[9[9[9[2[A]]]AAA]AAA]AAA]AAAAAAAA]AA]AAA9[9[9[9[9[9[9[2[EC]]]ECECEC...
result:
wrong answer incorrect path
Subtask #6:
score: 0
Wrong Answer
Test #55:
score: 0
Wrong Answer
time: 1ms
memory: 3660kb
input:
9999999999
output:
2[2[2[2[2[2[2[2[2[2[9[9[9[9[9[9[9[2[A]]]AAA]AAA]AAA]AAAAAAAA]AA]AAA9[9[9[9[9[9[9[2[EC]]]ECECEC]ECECEC]ECECEC]ECECECECECECECEC]ECEC]ECECE2[2[2[9[9[9[9[9[9[2[A]]AA]AAAAAA]]AAAA]AAA]AAAAA9[9[9[9[9[9[2[EC]]ECEC]ECECECECECEC]]ECECECEC]ECECEC]ECECECECE2[9[9[9[9[9[9[A]A]AAA]]AA]A]AAAAAA9[9[9[9[9[9[EC]EC]EC...
result:
wrong answer incorrect path
Subtask #7:
score: 0
Wrong Answer
Test #64:
score: 0
Wrong Answer
time: 3ms
memory: 4380kb
input:
100000000000000
output:
9[9[9[9[9[9[9[9[9[9[9[9[9[9[4[A]]AAA]AAA]]AAAAA]AAAAAA]AAAA]AA]AAAAAAA]AA]AAAAAAA]AAAAA]AA]AAAAA]A9[9[9[9[9[9[9[9[9[9[9[9[9[9[4[EC]]ECECEC]ECECEC]]ECECECECEC]ECECECECECEC]ECECECEC]ECEC]ECECECECECECEC]ECEC]ECECECECECECEC]ECECECECEC]ECEC]ECECECECEC]E2[2[2[2[2[2[2[2[2[2[2[2[2[2[9[9[9[9[9[9[9[9[9[9[A]AA...
result:
wrong answer the length of your output (222816) exceeds the constraint (150000)
Subtask #8:
score: 0
Wrong Answer
Test #84:
score: 0
Wrong Answer
time: 0ms
memory: 4344kb
input:
99999999999999
output:
2[2[2[2[2[2[2[2[2[2[2[2[2[2[9[9[9[9[9[9[9[9[9[9[A]AAAAAA]AAAAAA]AAAAAAA]]AAAAAAA]AAAAA]A]AAA]AAAAAA]AAAAAA9[9[9[9[9[9[9[9[9[9[EC]ECECECECECEC]ECECECECECEC]ECECECECECECEC]]ECECECECECECEC]ECECECECEC]EC]ECECEC]ECECECECECEC]ECECECECECE2[2[2[9[9[9[9[9[9[9[9[9[A]AAAAAAAA]AAAAAA]AAAA]AAAAA]AAAA]]A]AAAAA]AA...
result:
wrong answer the length of your output (222567) exceeds the constraint (150000)
Subtask #9:
score: 0
Wrong Answer
Test #103:
score: 0
Wrong Answer
time: 2ms
memory: 5740kb
input:
1000000000000000000
output:
9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[6[A]]AAAAA]AAAAAAAA]AAAAA]AAAAAAAA]AAA]AAAAAAA]A]AAAA]]AAAAAA]AAA]AAAAAA]AAAAAAAA]AA]AAAAA]AA]]A9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[9[6[EC]]ECECECECEC]ECECECECECECECEC]ECECECECEC]ECECECECECECECEC]ECECEC]ECECECECECECEC]EC]ECECECEC]]ECECECECECEC]ECECEC]ECECECECECEC]EC...
result:
wrong answer the length of your output (504242) exceeds the constraint (150000)
Subtask #10:
score: 0
Wrong Answer
Test #128:
score: 0
Wrong Answer
time: 7ms
memory: 6376kb
input:
999999999999999999
output:
2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[9[9[9[9[9[9[9[9[9[9[9[9[9[A]AAAA]AAAA]AAAAA]]AAA]AAAAA]AAA]AAAAAAAA]A]AAA]AAAAA]AAAAAA]9[9[9[9[9[9[9[9[9[9[9[9[9[EC]ECECECEC]ECECECEC]ECECECECEC]]ECECEC]ECECECECEC]ECECEC]ECECECECECECECEC]EC]ECECEC]ECECECECEC]ECECECECEC]ECECECECECECECECE2[2[2[9[9[9[9[9[9[9[9[9[9[9...
result:
wrong answer the length of your output (503903) exceeds the constraint (150000)