結果

問題 No.82 市松模様
ユーザー maspymaspy
提出日時 2020-01-01 11:40:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 378 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 29,656 KB
最終ジャッジ日時 2023-08-14 03:54:49
合計ジャッジ時間 3,465 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
29,472 KB
testcase_01 AC 124 ms
29,540 KB
testcase_02 AC 124 ms
29,480 KB
testcase_03 AC 125 ms
29,488 KB
testcase_04 AC 124 ms
29,588 KB
testcase_05 AC 124 ms
29,656 KB
testcase_06 AC 127 ms
29,596 KB
testcase_07 AC 128 ms
29,584 KB
testcase_08 AC 127 ms
29,640 KB
testcase_09 AC 126 ms
29,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

W,H,C = read().split()
W,H = map(int,(W,H))

A = np.empty((H,W),'U1')

if C == b'B':
    x,y = 'BW'
else:
    x,y = 'WB'
A[::2,::2] = x
A[1::2,1::2] = x
A[1::2,::2] = y
A[::2,1::2] = y

print('\n'.join(''.join(row) for row in A.astype(str)))
0