結果
問題 | No.82 市松模様 |
ユーザー |
![]() |
提出日時 | 2017-01-21 21:03:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 5,000 ms |
コード長 | 468 bytes |
コンパイル時間 | 101 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-23 04:29:12 |
合計ジャッジ時間 | 1,064 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
import itertoolsif __name__ == '__main__':w, h, c = (int(token) if x != 2 else token for x, token in enumerate(input().split()))matrix = [[None for _ in range(w)] for _ in range(h)]matrix[0][0] = cfor x in range(1, h): matrix[x][0] = 'B' if matrix[x - 1][0] == 'W' else 'W'for x, y in itertools.product(range(h), range(1, w)): matrix[x][y] = 'B' if matrix[x][y - 1] == 'W' else 'W'print('\n'.join(''.join(row) for row in matrix))