結果

問題 No.82 市松模様
ユーザー 2329 N2329 N
提出日時 2020-09-13 13:07:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 503 bytes
コンパイル時間 734 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 7,928 KB
最終ジャッジ日時 2023-09-02 19:02:46
合計ジャッジ時間 1,102 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,828 KB
testcase_01 AC 16 ms
7,808 KB
testcase_02 AC 15 ms
7,872 KB
testcase_03 AC 15 ms
7,768 KB
testcase_04 AC 15 ms
7,796 KB
testcase_05 AC 15 ms
7,916 KB
testcase_06 AC 16 ms
7,832 KB
testcase_07 AC 16 ms
7,824 KB
testcase_08 AC 16 ms
7,928 KB
testcase_09 AC 15 ms
7,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w, h, c_1 = input().split()
w = int(w)
h = int(h)
c_2 = 0
if c_1 == "B":
    c_2 = "W"
elif c_1 == "W":
    c_2 = "B"

if w > 1:
    im_1 = c_1 + c_2
    l_1 = ''
    for i in range(w//2):
        l_1 += im_1
    if w % 2 == 1:
        l_1 += c_1

    im_2 = c_2 + c_1
    l_2 = ''
    for i in range(w//2):
        l_2 += im_2
    if w % 2 == 1:
        l_2 += c_2
elif w == 1:
    l_1 = c_1
    l_2 = c_2


for i in range(h):
    if i % 2 == 0:
        print(l_1)
    if i % 2 == 1:
        print(l_2)
0