QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#623150 | #5731. Checkerboard | Nicolas125841 | AC ✓ | 0ms | 3792kb | C++20 | 633b | 2024-10-09 10:23:34 | 2024-10-09 10:23:34 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int R, C, A, B;
cin >> R >> C >> A >> B;
vector<int> as(A), bs(B);
for(int i = 0; i < A; i++)
cin >> as[i];
for(int i = 0; i < B; i++)
cin >> bs[i];
int a = 0, t = 0;
for(int r = 0; r < R; r++) {
if(t == as[a]) {
t = 0;
a++;
}
t++;
for(int i = 0; i < B; i++) {
for(int j = 0; j < bs[i]; j++) {
cout << ((a + i) % 2 ? "W" : "B");
}
}
cout << "\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3792kb
input:
6 5 3 2 1 2 3 3 2
output:
BBBWW WWWBB WWWBB BBBWW BBBWW BBBWW
result:
ok 6 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
4 4 2 2 1 3 3 1
output:
BBBW WWWB WWWB WWWB
result:
ok 4 lines
Test #3:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
20 20 4 14 5 2 9 4 1 2 1 1 1 1 1 1 1 1 1 1 4 3
output:
BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW WBBWBWBWBWBWBWWWWBBB WBBWBWBWBWBWBWWWWBBB BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW BWWBWBWBWBWBWBBBBWWW BWWBWB...
result:
ok 20 lines
Test #4:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
50 2 43 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 3 1 2 1 1 1 1 3 1 1 1 1 1 1 1
output:
BW WB BW BW WB BW WB BW WB BW WB BW WB BW WB BW WB BW WB BW WB BW WB BW WB BW BW WB BW WB BW WB BW BW BW WB BW BW WB BW WB BW WB WB WB BW WB BW WB BW
result:
ok 50 lines
Test #5:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
1 50 1 5 1 1 10 11 22 6
output:
BWWWWWWWWWWBBBBBBBBBBBWWWWWWWWWWWWWWWWWWWWWWBBBBBB
result:
ok single line: 'BWWWWWWWWWWBBBBBBBBBBBWWWWWWWWWWWWWWWWWWWWWWBBBBBB'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
50 1 17 1 4 1 1 1 6 2 3 1 3 5 1 4 5 1 6 2 4 1
output:
B B B B W B W B B B B B B W W B B B W B B B W W W W W B W W W W B B B B B W B B B B B B W W B B B B
result:
ok 50 lines
Test #7:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
2 50 2 3 1 1 14 18 18
output:
BBBBBBBBBBBBBBWWWWWWWWWWWWWWWWWWBBBBBBBBBBBBBBBBBB WWWWWWWWWWWWWWBBBBBBBBBBBBBBBBBBWWWWWWWWWWWWWWWWWW
result:
ok 2 lines
Test #8:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
50 50 29 44 2 1 1 1 2 1 3 1 1 2 3 3 1 1 2 1 1 3 2 3 3 1 1 2 1 3 1 1 2 1 1 1 2 1 1 2 1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1
output:
BWBWWBWBBWBWBBWBWBWBWBWBBWBWWBWBWBWBWBWBBWBWBWBWBW BWBWWBWBBWBWBBWBWBWBWBWBBWBWWBWBWBWBWBWBBWBWBWBWBW WBWBBWBWWBWBWWBWBWBWBWBWWBWBBWBWBWBWBWBWWBWBWBWBWB BWBWWBWBBWBWBBWBWBWBWBWBBWBWWBWBWBWBWBWBBWBWBWBWBW WBWBBWBWWBWBWWBWBWBWBWBWWBWBBWBWBWBWBWBWWBWBWBWBWB BWBWWBWBBWBWBBWBWBWBWBWBBWBWWBWBWBWBWBWBBWBWB...
result:
ok 50 lines