結果

問題 No.82 市松模様
ユーザー miya145592miya145592
提出日時 2023-05-03 19:06:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 343 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 75,960 KB
最終ジャッジ日時 2023-08-14 02:26:25
合計ジャッジ時間 1,842 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,340 KB
testcase_01 AC 70 ms
71,212 KB
testcase_02 AC 70 ms
71,476 KB
testcase_03 AC 70 ms
71,416 KB
testcase_04 AC 69 ms
71,364 KB
testcase_05 AC 70 ms
71,092 KB
testcase_06 AC 69 ms
71,300 KB
testcase_07 AC 69 ms
71,188 KB
testcase_08 AC 75 ms
75,940 KB
testcase_09 AC 75 ms
75,960 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