結果

問題 No.82 市松模様
ユーザー lam6er
提出日時 2025-03-20 18:58:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 49 ms / 5,000 ms
コード長 321 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,492 KB
実行使用メモリ 59,436 KB
最終ジャッジ日時 2025-03-20 18:59:51
合計ジャッジ時間 1,111 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

# Read input
W, H, C = input().split()
W = int(W)
H = int(H)

# Determine the other color
other = 'B' if C == 'W' else 'W'

# Generate each row
for i in range(H):
    row = []
    for j in range(W):
        if (i + j) % 2 == 0:
            row.append(C)
        else:
            row.append(other)
    print(''.join(row))
0