QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#623132#5731. CheckerboardchalupaWA 0ms3588kbC++17858b2024-10-09 10:19:092024-10-09 10:19:12

Judging History

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

  • [2024-10-09 10:19:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3588kb
  • [2024-10-09 10:19:09]
  • 提交

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'