結果

問題 No.351 市松スライドパズル
ユーザー Konton7
提出日時 2019-05-23 22:47:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 384 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 79,424 KB
最終ジャッジ日時 2024-09-17 09:54:24
合計ジャッジ時間 7,073 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 4
other TLE * 1 -- * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = [ int(v) for v in input().split() ]
n = int(input())
rotate_list = []

for i in range(n):
	rotate_list.append(input())
y, x = 0, 0

for i in range(n):
	s = rotate_list[n-1-i]
	
	ope, target = s.split(" ")
	if int(target) == x:
		if ope == "R":
			x = (x-1) % w
	if int(target) == y:
		if ope == "C":
			y = (y-1) % h

if (x + y) % 2 == 0:
	print("white")
else:
	print("black")
0