QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#121312#4327. Šeširiplatelet100 ✓32ms3560kbC++17340b2023-07-07 22:13:152023-07-07 22:13:17

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-07 22:13:17]
  • 评测
  • 测评结果:100
  • 用时:32ms
  • 内存:3560kb
  • [2023-07-07 22:13:15]
  • 提交

answer

#include <iostream>
using namespace std;
int main() {
    ios::sync_with_stdio(0);
    int n;
    cin >> n;
    int mask = n & 1 ? 0x55555555 : 0xaaaaaaaa;
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < 1 << (n - 1); j++)
            cout << "BC"[__builtin_parity(j & mask) ^ (i & 1)];
        cout << '\n';
    }
}

详细

Subtask #1:

score: 7
Accepted

Test #1:

score: 7
Accepted
time: 1ms
memory: 3396kb

input:

4

output:

BBCCBBCC
CCBBCCBB
BBCCBBCC
CCBBCCBB

result:

ok good plan!

Subtask #2:

score: 7
Accepted

Test #2:

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

input:

5

output:

BCBCCBCBBCBCCBCB
CBCBBCBCCBCBBCBC
BCBCCBCBBCBCCBCB
CBCBBCBCCBCBBCBC
BCBCCBCBBCBCCBCB

result:

ok good plan!

Subtask #3:

score: 7
Accepted

Test #3:

score: 7
Accepted
time: 1ms
memory: 3396kb

input:

6

output:

BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBB
CCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCC
BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBB
CCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCC
BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBB
CCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCC

result:

ok good plan!

Subtask #4:

score: 7
Accepted

Test #4:

score: 7
Accepted
time: 1ms
memory: 3424kb

input:

7

output:

BCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBC
CBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCB
BCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBC
CBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCB
BCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCB...

result:

ok good plan!

Subtask #5:

score: 7
Accepted

Test #5:

score: 7
Accepted
time: 1ms
memory: 3396kb

input:

8

output:

BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCC
CCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBB
BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBB...

result:

ok good plan!

Subtask #6:

score: 7
Accepted

Test #6:

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

input:

9

output:

BCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCB
CBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBC...

result:

ok good plan!

Subtask #7:

score: 7
Accepted

Test #7:

score: 7
Accepted
time: 0ms
memory: 3492kb

input:

10

output:

BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCC...

result:

ok good plan!

Subtask #8:

score: 7
Accepted

Test #8:

score: 7
Accepted
time: 1ms
memory: 3404kb

input:

11

output:

BCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCB...

result:

ok good plan!

Subtask #9:

score: 7
Accepted

Test #9:

score: 7
Accepted
time: 1ms
memory: 3428kb

input:

12

output:

BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCC...

result:

ok good plan!

Subtask #10:

score: 7
Accepted

Test #10:

score: 7
Accepted
time: 2ms
memory: 3488kb

input:

13

output:

BCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCB...

result:

ok good plan!

Subtask #11:

score: 6
Accepted

Test #11:

score: 6
Accepted
time: 3ms
memory: 3348kb

input:

14

output:

BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCC...

result:

ok good plan!

Subtask #12:

score: 6
Accepted

Test #12:

score: 6
Accepted
time: 5ms
memory: 3356kb

input:

15

output:

BCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCB...

result:

ok good plan!

Subtask #13:

score: 6
Accepted

Test #13:

score: 6
Accepted
time: 9ms
memory: 3352kb

input:

16

output:

BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCC...

result:

ok good plan!

Subtask #14:

score: 6
Accepted

Test #14:

score: 6
Accepted
time: 17ms
memory: 3404kb

input:

17

output:

BCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCBBCBCBCBCCBCBBCBCCBCBCBCBBCBCCBCB...

result:

ok good plan!

Subtask #15:

score: 6
Accepted

Test #15:

score: 6
Accepted
time: 32ms
memory: 3408kb

input:

18

output:

BBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBBBCCBBCCCCBBCCBBCCBBCCBBBBCC...

result:

ok good plan!

Extra Test:

score: 0
Extra Test Passed