QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#623132 | #5731. Checkerboard | chalupa | WA | 0ms | 3588kb | C++17 | 858b | 2024-10-09 10:19:09 | 2024-10-09 10:19:12 |
Judging History
answer
#include <iostream>
#include <vector>
#include <string>
int main() {
int R, C, A, B;
std::cin >> R >> C >> A >> B;
std::vector<int> row_heights;
for (int i = 0; i < A; i++) {
int row_height;
std::cin >> row_height;
row_heights.push_back(row_height);
}
std::vector<int> col_widths;
for (int i = 0; i < B; i++) {
int col_width;
std::cin >> col_width;
col_widths.push_back(col_width);
}
bool white = false;
for (int row_height : row_heights) {
for (int zed = 0; zed < row_height; zed++) {
for (int col_width : col_widths) {
for (int a = 0; a < col_width; a++) {
std::cout << (white ? 'W' : 'B');
}
if (col_width != 1) {
white = !white;
}
}
std::cout << "\n";
}
white = !white;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
input:
6 5 3 2 1 2 3 3 2
output:
BBBWW WWWBB WWWBB BBBWW BBBWW BBBWW
result:
ok 6 lines
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3588kb
input:
4 4 2 2 1 3 3 1
output:
BBBW BBBW WWWB BBBW
result:
wrong answer 2nd lines differ - expected: 'WWWB', found: 'BBBW'