QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#120935#4327. Šeširiplatelet#0 12ms5712kbC++171.3kb2023-07-07 12:48:182024-07-04 00:29:02

Judging History

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

  • [2024-07-04 00:29:02]
  • 评测
  • 测评结果:0
  • 用时:12ms
  • 内存:5712kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-07 12:48:18]
  • 提交

answer

#include <bits/stdc++.h>
#define rep(i, l, r) for(int i = (l); i <= (r); i++)
#define per(i, r, l) for(int i = (r); i >= (l); i--)
#define mem(a, b) memset(a, b, sizeof a)
#define For(i, l, r) for(int i = (l), i##e = (r); i < i##e; i++)
#define pb push_back
#define eb emplace_back
#define SZ(x) int(x.size())
#define all(x) x.begin(), x.end()

using namespace std;
using ll = long long;

template<class T> inline T& cmin(T& a, const T& b) { if(b < a) a = b; return a; }
template<class T> inline T& cmax(T& a, const T& b) { if(a < b) a = b; return a; }
template<class... Args> void print(Args&&... args) {
    ((cout << args << ' '), ...);
}
template<class... Args> void println(Args&&... args) {
    print(args...), cout << endl;
}

char a[18][1 << 17 | 8];

int main() {
    cin.tie(0)->sync_with_stdio(0);
    int n;
    cin >> n;
    For(S, 0, 1 << n - 1) {
        auto g = [&](int i) {
            return S >> i & 1;
        };
        a[0][S] = g(0);
        a[1][S] = !g(0);
        a[2][S] = g(2);
        a[3][S] = !g(2);
        if(g(0) == 0 && g(1) == 1)
            a[2][S] = a[3][S] = 0;
        if(g(0) == 0 && g(1) == 1)
            a[2][S] = a[3][S] = 1;
    }
    For(i, 0, n) {
        For(S, 0, 1 << n - 1)
            cout << "BC"[a[i][S]];
        cout << '\n';
    }
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

input:

4

output:

BCBCBCBC
CBCBCBCB
BBCBCCCC
CCCCBBCB

result:

wrong answer your plan fails on CCBB

Subtask #2:

score: 0
Wrong Answer

Test #2:

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

input:

5

output:

BCBCBCBCBCBCBCBC
CBCBCBCBCBCBCBCB
BBCBCCCCBBCBCCCC
CCCCBBCBCCCCBBCB
BBBBBBBBBBBBBBBB

result:

wrong answer your plan fails on CCCBB

Subtask #3:

score: 0
Wrong Answer

Test #3:

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

input:

6

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC
CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB
BBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCC
CCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

result:

wrong answer your plan fails on CCCBBB

Subtask #4:

score: 0
Wrong Answer

Test #4:

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

input:

7

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC
CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB
BBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCC
CCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB...

result:

wrong answer your plan fails on CCCBBBB

Subtask #5:

score: 0
Wrong Answer

Test #5:

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

input:

8

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC
CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB
BBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBBCBCCCCBB...

result:

wrong answer your plan fails on CCCBBBBB

Subtask #6:

score: 0
Wrong Answer

Test #6:

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

input:

9

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC
CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBB

Subtask #7:

score: 0
Wrong Answer

Test #7:

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

input:

10

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBBB

Subtask #8:

score: 0
Wrong Answer

Test #8:

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

input:

11

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBBBB

Subtask #9:

score: 0
Wrong Answer

Test #9:

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

input:

12

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBBBBB

Subtask #10:

score: 0
Wrong Answer

Test #10:

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

input:

13

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBBBBBB

Subtask #11:

score: 0
Wrong Answer

Test #11:

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

input:

14

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBBBBBBB

Subtask #12:

score: 0
Wrong Answer

Test #12:

score: 0
Wrong Answer
time: 2ms
memory: 5712kb

input:

15

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBBBBBBBB

Subtask #13:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 4ms
memory: 3748kb

input:

16

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBBBBBBBBB

Subtask #14:

score: 0
Wrong Answer

Test #14:

score: 0
Wrong Answer
time: 8ms
memory: 3856kb

input:

17

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBBBBBBBBBB

Subtask #15:

score: 0
Wrong Answer

Test #15:

score: 0
Wrong Answer
time: 12ms
memory: 4004kb

input:

18

output:

BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC...

result:

wrong answer your plan fails on CCCBBBBBBBBBBBBBBB