QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#356651#8300. Game DesignFOY#AC ✓1ms3808kbC++14841b2024-03-18 06:54:442024-03-18 06:54:44

Judging History

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

  • [2024-03-18 06:54:44]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3808kb
  • [2024-03-18 06:54:44]
  • 提交

answer

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
using vi = vector<int>;

int main() {
	ll w = 1ll<<29;
	ll k; cin >> k;

	if (k == 1) {
		cout << 2 << endl;
		cout << 1 << endl;
		cout << 2 << ' ' << 1 << endl;
		return 0;
	}

	vi parent, val;
	int cur = 0, prev = 0;
	while (k) {
		parent.push_back(prev);
		if (k&1) {
			val.push_back(w);
		}
		else {
			val.push_back(w+1);
		}
		w/=2;
		val.push_back(w);
		val.push_back(w);
		parent.push_back(cur+1);
		parent.push_back(cur+2);
		prev = cur+1;
		cur+=3;
		k/=2;
	}
	parent.pop_back();
	parent.pop_back();
	val.pop_back();
	val.pop_back();
	cout << parent.size() << endl;
	for (int i = 1; i < parent.size(); i++) cout << parent[i] << ' ';
	cout << endl;
	for (int i : val) cout << i << ' ';
	cout << endl;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3560kb

input:

2

output:

4
1 2 1 
536870913 268435456 268435456 268435456 

result:

ok correct

Test #2:

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

input:

1

output:

2
1
2 1

result:

ok correct

Test #3:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

3

output:

4
1 2 1 
536870912 268435456 268435456 268435456 

result:

ok correct

Test #4:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

4

output:

7
1 2 1 4 5 4 
536870913 268435456 268435456 268435457 134217728 134217728 134217728 

result:

ok correct

Test #5:

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

input:

5

output:

7
1 2 1 4 5 4 
536870912 268435456 268435456 268435457 134217728 134217728 134217728 

result:

ok correct

Test #6:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

6

output:

7
1 2 1 4 5 4 
536870913 268435456 268435456 268435456 134217728 134217728 134217728 

result:

ok correct

Test #7:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

7

output:

7
1 2 1 4 5 4 
536870912 268435456 268435456 268435456 134217728 134217728 134217728 

result:

ok correct

Test #8:

score: 0
Accepted
time: 0ms
memory: 3744kb

input:

8

output:

10
1 2 1 4 5 4 7 8 7 
536870913 268435456 268435456 268435457 134217728 134217728 134217729 67108864 67108864 67108864 

result:

ok correct

Test #9:

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

input:

9

output:

10
1 2 1 4 5 4 7 8 7 
536870912 268435456 268435456 268435457 134217728 134217728 134217729 67108864 67108864 67108864 

result:

ok correct

Test #10:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

11

output:

10
1 2 1 4 5 4 7 8 7 
536870912 268435456 268435456 268435456 134217728 134217728 134217729 67108864 67108864 67108864 

result:

ok correct

Test #11:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

23

output:

13
1 2 1 4 5 4 7 8 7 10 11 10 
536870912 268435456 268435456 268435456 134217728 134217728 134217728 67108864 67108864 67108865 33554432 33554432 33554432 

result:

ok correct

Test #12:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

64

output:

19
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 
536870913 268435456 268435456 268435457 134217728 134217728 134217729 67108864 67108864 67108865 33554432 33554432 33554433 16777216 16777216 16777217 8388608 8388608 8388608 

result:

ok correct

Test #13:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

87

output:

19
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 
536870912 268435456 268435456 268435456 134217728 134217728 134217728 67108864 67108864 67108865 33554432 33554432 33554432 16777216 16777216 16777217 8388608 8388608 8388608 

result:

ok correct

Test #14:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

103

output:

19
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 
536870912 268435456 268435456 268435456 134217728 134217728 134217728 67108864 67108864 67108865 33554432 33554432 33554433 16777216 16777216 16777216 8388608 8388608 8388608 

result:

ok correct

Test #15:

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

input:

128

output:

22
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 
536870913 268435456 268435456 268435457 134217728 134217728 134217729 67108864 67108864 67108865 33554432 33554432 33554433 16777216 16777216 16777217 8388608 8388608 8388609 4194304 4194304 4194304 

result:

ok correct

Test #16:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

325

output:

25
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 
536870912 268435456 268435456 268435457 134217728 134217728 134217728 67108864 67108864 67108865 33554432 33554432 33554433 16777216 16777216 16777217 8388608 8388608 8388608 4194304 4194304 4194305 2097152 2097152 2097152 

result:

ok correct

Test #17:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

567

output:

28
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 
536870912 268435456 268435456 268435456 134217728 134217728 134217728 67108864 67108864 67108865 33554432 33554432 33554432 16777216 16777216 16777216 8388608 8388608 8388609 4194304 4194304 4194305 2097152 2097152 2097153 1...

result:

ok correct

Test #18:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

9999

output:

40
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 
536870912 268435456 268435456 268435456 134217728 134217728 134217728 67108864 67108864 67108864 33554432 33554432 33554433 16777216 16777216 16777217 8388608 8388608 8388609 4194304 41943...

result:

ok correct

Test #19:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

93256

output:

49
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 
536870913 268435456 268435456 268435457 134217728 134217728 134217729 67108864 67108864 67108864 33554432 33554432 33554433 16777216 16777216 16777217 8388608 83...

result:

ok correct

Test #20:

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

input:

3532462

output:

64
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 
536870913 268435456 268435456 268435456 134217728 134217728 134217728 67108864 67108864 67108864 33554432 33554432 3...

result:

ok correct

Test #21:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

54389236

output:

76
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 
536870913 268435456 268435456 268435457 134217728 134217728 134217728 67108864 6...

result:

ok correct

Test #22:

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

input:

93453967

output:

79
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 
536870912 268435456 268435456 268435456 134217728 134217728 134217728 6...

result:

ok correct

Test #23:

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

input:

1000000000

output:

88
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 
536870913 268435456 268435456 268435457 1342...

result:

ok correct

Test #24:

score: 0
Accepted
time: 0ms
memory: 3468kb

input:

999999999

output:

88
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 
536870912 268435456 268435456 268435456 1342...

result:

ok correct

Test #25:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

888888888

output:

88
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 
536870913 268435456 268435456 268435457 1342...

result:

ok correct

Test #26:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

333333334

output:

85
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 
536870913 268435456 268435456 268435456 134217728 134...

result:

ok correct

Test #27:

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

input:

83495645

output:

79
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 
536870912 268435456 268435456 268435457 134217728 134217728 134217728 6...

result:

ok correct

Test #28:

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

input:

894567865

output:

88
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 
536870912 268435456 268435456 268435457 1342...

result:

ok correct

Test #29:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

88479456

output:

79
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 
536870913 268435456 268435456 268435457 134217728 134217728 134217729 6...

result:

ok correct

Test #30:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

1000000

output:

58
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 
536870913 268435456 268435456 268435457 134217728 134217728 134217729 67108864 67108864 67108865 33554432 33554432 33554433 16777216 1...

result:

ok correct

Test #31:

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

input:

429085001

output:

85
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 
536870912 268435456 268435456 268435457 134217728 134...

result:

ok correct

Test #32:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

882138811

output:

88
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 
536870912 268435456 268435456 268435456 1342...

result:

ok correct

Test #33:

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

input:

513157691

output:

85
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 
536870912 268435456 268435456 268435456 134217728 134...

result:

ok correct

Test #34:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

813900859

output:

88
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 85 86 85 
536870912 268435456 268435456 268435456 1342...

result:

ok correct

Test #35:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

454848871

output:

85
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 
536870912 268435456 268435456 268435456 134217728 134...

result:

ok correct

Test #36:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

151401319

output:

82
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 
536870912 268435456 268435456 268435456 134217728 134217728 13...

result:

ok correct

Test #37:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

280898521

output:

85
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 
536870912 268435456 268435456 268435457 134217728 134...

result:

ok correct

Test #38:

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

input:

412968047

output:

85
1 2 1 4 5 4 7 8 7 10 11 10 13 14 13 16 17 16 19 20 19 22 23 22 25 26 25 28 29 28 31 32 31 34 35 34 37 38 37 40 41 40 43 44 43 46 47 46 49 50 49 52 53 52 55 56 55 58 59 58 61 62 61 64 65 64 67 68 67 70 71 70 73 74 73 76 77 76 79 80 79 82 83 82 
536870912 268435456 268435456 268435456 134217728 134...

result:

ok correct

Extra Test:

score: 0
Extra Test Passed