問題一覧 > 通常問題

No.82 Checkered Pattern

レベル : / AI推定難易度 : 111 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 746
作問者 : nmnmnmnmnmnmnm
お気に入りにしたユーザー ProblemId : 201 / 自分の提出
問題文最終更新日: 2026-06-27 00:48:14
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 60 (順位表) の他の問題:

Problem Statement

Given the width W, the height H, and the color of the top-left cell, draw a checkered pattern.
A checkered pattern is a pattern in which black and white appear alternately.
The pattern shall be drawn using 'B' for black and 'W' for white.

See the samples for details.

Input

W H C

Three pieces of information are given: the width W, the height H, and the color C of the top-left cell.
W and H are integers between 1 and 50, inclusive. (1<=W,H<=50)
C is either 'B' or 'W'.

Output

Draw the checkered pattern. Do not forget a newline at the end of the last line as well.

Sample

Sample 1
Input
4 3 B
Output
BWBW
WBWB
BWBW

A checkered pattern with black 'B' at the top left, width 4, and height 3 has been drawn.

Sample 2
Input
3 4 W
Output
WBW
BWB
WBW
BWB

A checkered pattern with white 'W' at the top left, width 3, and height 4 has been drawn.

Sample 3
Input
1 1 W
Output
W

Visually this does not look like a checkered pattern, but it is considered a correct answer.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。