Logo
(追記) (追記ここまで)

24654번 - Build The Grid 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB118777368.868%

문제

Given is a square grid of $N \times N$ squares. Your task is to paint each square of the grid either white or black such that:

  • The white squares are connected: for any two white squares, you can go from one to the other by moving only between white squares that share a side.
  • Each black square shares a side with at least one white square.
  • Denote the number of black cells in the $i$-th row as $p_i$. The sequence $P = (p_1, p_2, \ldots, p_N)$ is then a permutation of integers between 0ドル$ and $N-1,ドル inclusive.
  • Denote the number of black cells in the $j$-th column as $q_j$. The sequence $Q = (q_1, q_2, \ldots, q_N)$ is then a permutation of integers between 0ドル$ and $N-1,ドル inclusive.

It can be shown that such a construction always exists.

입력

The input consists of one integer $N$ (2ドル \le N \le 500$).

출력

Print $N$ lines. On the $i$-th line, print a string of length $N$ consisting of characters 'B' and 'W'. The $j$-th character in the $i$-th string corresponds to the square in $i$-th row and $j$-th column: 'B' denotes black squares and 'W' denotes white squares.

제한

예제 입력 1

3

예제 출력 1

WWB
BWB
WWW

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2022 > Day 1: Kyoto U Contest 2 B번

Contest > Open Cup > 2021/2022 Season > Stage 10: Grand Prix of Kyoto B번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /