結果

問題 No.82 市松模様
ユーザー maspymaspy
提出日時 2020-01-01 11:40:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 532 ms / 5,000 ms
コード長 378 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,080 KB
最終ジャッジ日時 2024-05-01 16:44:37
合計ジャッジ時間 7,437 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 531 ms
43,956 KB
testcase_01 AC 521 ms
44,076 KB
testcase_02 AC 524 ms
44,076 KB
testcase_03 AC 524 ms
44,080 KB
testcase_04 AC 523 ms
44,076 KB
testcase_05 AC 522 ms
43,940 KB
testcase_06 AC 524 ms
43,940 KB
testcase_07 AC 532 ms
43,688 KB
testcase_08 AC 529 ms
43,728 KB
testcase_09 AC 523 ms
43,728 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