結果

問題 No.82 市松模様
ユーザー pypypymipypypymi
提出日時 2022-02-02 11:53:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 5,000 ms
コード長 400 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 71,560 KB
最終ジャッジ日時 2023-09-02 02:42:30
合計ジャッジ時間 1,744 ms
ジャッジサーバーID
(参考情報)
judge16 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,556 KB
testcase_01 AC 67 ms
71,036 KB
testcase_02 AC 67 ms
71,560 KB
testcase_03 AC 69 ms
71,152 KB
testcase_04 AC 64 ms
71,512 KB
testcase_05 AC 65 ms
71,172 KB
testcase_06 AC 67 ms
71,324 KB
testcase_07 AC 66 ms
71,480 KB
testcase_08 AC 67 ms
71,364 KB
testcase_09 AC 66 ms
71,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w,h,c = input().split()
w  = int(w)
h = int(h)
str1 = "".join(["W" if i%2==0 else "B" for i in range(w)])
str2 = "".join(["B" if i%2==0 else "W" for i in range(w)])
for i in range(h):
   if c=="W":
        if i%2==0:
            print(str1)
        else:
            print(str2)
   else:
       if i%2==0:
            print(str2)
       else:
            print(str1)
       
       
       

        
0