結果

問題 No.82 市松模様
ユーザー miya145592miya145592
提出日時 2023-05-03 19:06:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 343 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 81,864 KB
実行使用メモリ 60,592 KB
最終ジャッジ日時 2024-05-01 15:25:44
合計ジャッジ時間 1,366 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,284 KB
testcase_01 AC 38 ms
53,096 KB
testcase_02 AC 36 ms
53,556 KB
testcase_03 AC 34 ms
52,944 KB
testcase_04 AC 35 ms
52,892 KB
testcase_05 AC 34 ms
52,524 KB
testcase_06 AC 34 ms
53,148 KB
testcase_07 AC 39 ms
52,480 KB
testcase_08 AC 39 ms
58,584 KB
testcase_09 AC 40 ms
60,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

W, H, C = input().split()
W = int(W)
H = int(H)
ans = [['' for _ in range(W)] for _ in range(H)]
for i in range(H):
    for j in range(W):
        if (i+j)%2==0:
            ans[i][j] = C 
        else:
            if C=="B":
                ans[i][j] = "W"
            else:
                ans[i][j] = "B"
for a in ans:
    print("".join(a))
0