結果

問題 No.82 市松模様
ユーザー brthyyjpbrthyyjp
提出日時 2020-12-06 19:04:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 514 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 81,656 KB
実行使用メモリ 59,832 KB
最終ジャッジ日時 2023-10-17 15:29:00
合計ジャッジ時間 1,337 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,452 KB
testcase_01 AC 36 ms
53,452 KB
testcase_02 AC 37 ms
53,452 KB
testcase_03 AC 36 ms
53,452 KB
testcase_04 AC 37 ms
53,452 KB
testcase_05 AC 36 ms
53,452 KB
testcase_06 AC 37 ms
53,452 KB
testcase_07 AC 37 ms
53,452 KB
testcase_08 AC 58 ms
59,828 KB
testcase_09 AC 42 ms
59,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w,h,c = map(str, input().split())
w,h = int(w), int(h)
if c == 'B':
    ans = [[0]*w for _ in range(h)]
    for i in range(h):
        for j in range(w):
            if (i+j)%2 == 0:
                ans[i][j] = 'B'
            else:
                ans[i][j] = 'W'
else:
    ans = [[0]*w for _ in range(h)]
    for i in range(h):
        for j in range(w):
            if (i+j)%2 == 0:
                ans[i][j] = 'W'
            else:
                ans[i][j] = 'B'
for i in range(h):
    print(''.join(ans[i]))
0