結果

問題 No.82 市松模様
ユーザー lloyzlloyz
提出日時 2023-07-15 23:52:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 11,864 KB
実行使用メモリ 10,096 KB
最終ジャッジ日時 2023-10-17 09:52:24
合計ジャッジ時間 1,133 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,072 KB
testcase_01 AC 26 ms
10,072 KB
testcase_02 AC 25 ms
10,072 KB
testcase_03 AC 24 ms
10,072 KB
testcase_04 AC 25 ms
10,072 KB
testcase_05 AC 23 ms
10,072 KB
testcase_06 AC 25 ms
10,076 KB
testcase_07 AC 26 ms
10,080 KB
testcase_08 AC 25 ms
10,096 KB
testcase_09 AC 25 ms
10,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w, h, c = input().split()
w = int(w)
h = int(h)

ANS = [['' for _ in range(w)] for _ in range(h)]
cc = c
for i in range(h):
    if i % 2 == 0:
        cc = c
    else:
        if c == 'W':
            cc = 'B'
        else:
            cc = 'W'
    for j in range(w):
        ANS[i][j] = cc
        if cc == 'W':
            cc = 'B'
        else:
            cc = 'W'
for i in range(h):
    print(''.join(ANS[i]))
0