結果

問題 No.82 市松模様
ユーザー neko_the_shadowneko_the_shadow
提出日時 2017-01-21 21:03:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 468 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,944 KB
実行使用メモリ 8,304 KB
最終ジャッジ日時 2023-08-24 19:24:02
合計ジャッジ時間 866 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,152 KB
testcase_01 AC 15 ms
8,220 KB
testcase_02 AC 15 ms
8,144 KB
testcase_03 AC 16 ms
8,144 KB
testcase_04 AC 16 ms
8,304 KB
testcase_05 AC 15 ms
8,164 KB
testcase_06 AC 15 ms
8,224 KB
testcase_07 AC 15 ms
8,068 KB
testcase_08 AC 16 ms
8,176 KB
testcase_09 AC 16 ms
8,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

if __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] = c

    for 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))
0