QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#311107#5236. Wersja dla profesjonalistów [A]c202302010 1ms3900kbC++14842b2024-01-21 21:47:452024-01-21 21:47:45

Judging History

你现在查看的是最新测评结果

  • [2024-01-21 21:47:45]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:3900kb
  • [2024-01-21 21:47:45]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
const int maxn=3e5+5;

string str(int x) {
	string t="";
	while(x) t+=((x%10)+'0'), x/=10;
	reverse(t.begin(),t.end());
	return t;
}

string solve(int n) {
	if(n==1) return "AE";
	if(n==2) return "AEACA2E";
	string res="";
	res+="2[";
	int t=(n-1)/2, t2=t;
	if(n%2==0) ++t2;
	res+=solve(t);
	res+=']';
	if(n%2==0) {
		res+=str(t);
		res+="[AC]";
		res+='A';
		res+=str(t2);
		res+='E';	
	}
	res+=str(t2);
	res+="[AC]";
	res+=str(t);
	res+="[AC";
	res+=str(t2);
	res+="[EC]";
	res+=str(t2);
	res+='A';
	res+=']';
	res+='A';
	res+=str(n);
	res+='E';
	return res;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	int n; cin>>n;
	string res=solve(n);
	cout<<res;
	cout<<n<<'C'; cout<<'\n';
	return 0;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 1
Accepted
time: 0ms
memory: 3556kb

input:

1

output:

AE1C

result:

ok correct (length = 3)

Test #2:

score: 0
Accepted
time: 1ms
memory: 3564kb

input:

2

output:

AEACA2E2C

result:

ok correct (length = 13)

Test #3:

score: 0
Accepted
time: 1ms
memory: 3868kb

input:

4

output:

2[AE]1[AC]A2E2[AC]1[AC2[EC]2A]A4E4C

result:

ok correct (length = 30)

Test #4:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

5

output:

2[AEACA2E]2[AC]2[AC2[EC]2A]A5E5C

result:

ok correct (length = 43)

Test #5:

score: 0
Accepted
time: 1ms
memory: 3616kb

input:

6

output:

2[AEACA2E]2[AC]A3E3[AC]2[AC3[EC]3A]A6E6C

result:

ok correct (length = 53)

Test #6:

score: 0
Accepted
time: 1ms
memory: 3624kb

input:

7

output:

2[2[AE]1[AC]1[AC1[EC]1A]A3E]3[AC]3[AC3[EC]3A]A7E7C

result:

ok correct (length = 53)

Test #7:

score: -1
Wrong Answer
time: 1ms
memory: 3624kb

input:

10

output:

2[2[AE]1[AC]A2E2[AC]1[AC2[EC]2A]A4E]4[AC]A5E5[AC]4[AC5[EC]5A]A10E10C

result:

wrong answer invalid output

Subtask #2:

score: 0
Wrong Answer

Test #16:

score: 0
Wrong Answer
time: 1ms
memory: 3508kb

input:

320

output:

2[2[2[2[2[2[2[AE]1[AC]A2E2[AC]1[AC2[EC]2A]A4E]4[AC]4[AC4[EC]4A]A9E]9[AC]9[AC9[EC]9A]A19E]19[AC]19[AC19[EC]19A]A39E]39[AC]39[AC39[EC]39A]A79E]79[AC]79[AC79[EC]79A]A159E]159[AC]A160E160[AC]159[AC160[EC]160A]A320E320C

result:

wrong answer invalid output

Subtask #3:

score: 0
Wrong Answer

Test #28:

score: 0
Wrong Answer
time: 0ms
memory: 3648kb

input:

1000000

output:

2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[AEACA2E]2[AC]A3E3[AC]2[AC3[EC]3A]A6E]6[AC]A7E7[AC]6[AC7[EC]7A]A14E]14[AC]14[AC14[EC]14A]A29E]29[AC]A30E30[AC]29[AC30[EC]30A]A60E]60[AC]60[AC60[EC]60A]A121E]121[AC]121[AC121[EC]121A]A243E]243[AC]243[AC243[EC]243A]A487E]487[AC]487[AC487[EC]487A]A975E]975[AC]A976E976...

result:

wrong answer invalid output

Subtask #4:

score: 0
Wrong Answer

Test #37:

score: 0
Wrong Answer
time: 1ms
memory: 3636kb

input:

999999

output:

2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[2[AEACA2E]2[AC]A3E3[AC]2[AC3[EC]3A]A6E]6[AC]A7E7[AC]6[AC7[EC]7A]A14E]14[AC]14[AC14[EC]14A]A29E]29[AC]A30E30[AC]29[AC30[EC]30A]A60E]60[AC]60[AC60[EC]60A]A121E]121[AC]121[AC121[EC]121A]A243E]243[AC]243[AC243[EC]243A]A487E]487[AC]487[AC487[EC]487A]A975E]975[AC]A976E976...

result:

wrong answer invalid output

Subtask #5:

score: 0
Wrong Answer

Test #46:

score: 0
Wrong Answer
time: 1ms
memory: 3884kb

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[2[AE]1[AC]1[AC1[EC]1A]A3E]3[AC]3[AC3[EC]3A]A7E]7[AC]7[AC7[EC]7A]A15E]15[AC]15[AC15[EC]15A]A31E]31[AC]31[AC31[EC]31A]A63E]63[AC]63[AC63[EC]63A]A127E]127[AC]127[AC127[EC]127A]A255E]255[AC]255[AC255[EC]255A]A511E]511[AC]511[AC511[EC]511A]A1023E]...

result:

wrong answer invalid output

Subtask #6:

score: 0
Wrong Answer

Test #55:

score: 0
Wrong Answer
time: 1ms
memory: 3852kb

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[2[AE]1[AC]1[AC1[EC]1A]A3E]3[AC]3[AC3[EC]3A]A7E]7[AC]7[AC7[EC]7A]A15E]15[AC]15[AC15[EC]15A]A31E]31[AC]31[AC31[EC]31A]A63E]63[AC]63[AC63[EC]63A]A127E]127[AC]127[AC127[EC]127A]A255E]255[AC]255[AC255[EC]255A]A511E]511[AC]511[AC511[EC]511A]A1023E]...

result:

wrong answer invalid output

Subtask #7:

score: 0
Wrong Answer

Test #64:

score: 0
Wrong Answer
time: 0ms
memory: 3896kb

input:

100000000000000

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[2[AE]1[AC]1[AC1[EC]1A]A3E]3[AC]3[AC3[EC]3A]A7E]7[AC]7[AC7[EC]7A]A15E]15[AC]15[AC15[EC]15A]A31E]31[AC]31[AC31[EC]31A]A63E]63[AC]63[AC63[EC]63A]A127E]127[AC]127[AC127[EC]127A]A255E]255[AC]255[AC255[EC]255A]A511E]511[AC]511[AC511[EC]511A]A1023E]...

result:

wrong answer invalid output

Subtask #8:

score: 0
Wrong Answer

Test #84:

score: 0
Wrong Answer
time: 0ms
memory: 3588kb

input:

99999999999999

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[2[AE]1[AC]1[AC1[EC]1A]A3E]3[AC]3[AC3[EC]3A]A7E]7[AC]7[AC7[EC]7A]A15E]15[AC]15[AC15[EC]15A]A31E]31[AC]31[AC31[EC]31A]A63E]63[AC]63[AC63[EC]63A]A127E]127[AC]127[AC127[EC]127A]A255E]255[AC]255[AC255[EC]255A]A511E]511[AC]511[AC511[EC]511A]A1023E]...

result:

wrong answer invalid output

Subtask #9:

score: 0
Wrong Answer

Test #103:

score: 0
Wrong Answer
time: 1ms
memory: 3900kb

input:

1000000000000000000

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[2[AE]1[AC]1[AC1[EC]1A]A3E]3[AC]3[AC3[EC]3A]A7E]7[AC]7[AC7[EC]7A]A15E]15[AC]15[AC15[EC]15A]A31E]31[AC]31[AC31[EC]31A]A63E]63[AC]63[AC63[EC]63A]A127E]127[AC]127[AC127[EC]127A]A255E]255[AC]255[AC255[EC]255A]A511E]511[AC]511[AC511[EC]511A]A1023E]...

result:

wrong answer invalid output

Subtask #10:

score: 0
Wrong Answer

Test #128:

score: 0
Wrong Answer
time: 0ms
memory: 3596kb

input:

999999999999999999

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[2[AE]1[AC]1[AC1[EC]1A]A3E]3[AC]3[AC3[EC]3A]A7E]7[AC]7[AC7[EC]7A]A15E]15[AC]15[AC15[EC]15A]A31E]31[AC]31[AC31[EC]31A]A63E]63[AC]63[AC63[EC]63A]A127E]127[AC]127[AC127[EC]127A]A255E]255[AC]255[AC255[EC]255A]A511E]511[AC]511[AC511[EC]511A]A1023E]...

result:

wrong answer invalid output