結果

問題 No.82 市松模様
ユーザー 双六双六
提出日時 2020-07-22 10:38:16
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 144 ms / 5,000 ms
コード長 583 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 77,172 KB
最終ジャッジ日時 2023-09-01 22:33:30
合計ジャッジ時間 2,353 ms
ジャッジサーバーID
(参考情報)
judge13 / judge16
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
72,692 KB
testcase_01 AC 115 ms
72,856 KB
testcase_02 AC 115 ms
72,592 KB
testcase_03 AC 113 ms
72,724 KB
testcase_04 AC 115 ms
72,724 KB
testcase_05 AC 114 ms
72,540 KB
testcase_06 AC 114 ms
72,752 KB
testcase_07 AC 114 ms
72,956 KB
testcase_08 AC 144 ms
76,992 KB
testcase_09 AC 118 ms
77,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys; input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")
import copy

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	W, H, C = list(input().split())
	W = int(W)
	H = int(H)
	if C == "W":
		c = "B"
	else:
		c = "W"
	table = [[None] * W for i in range(H)]
	for i in range(H):
		for j in range(W):
			if (i + j) % 2 == 0:
				table[i][j] = C
			else:
				table[i][j] = c

	for i in range(H):
		print("".join(table[i]))

if __name__ == '__main__':
	main()
0