結果

問題 No.351 市松スライドパズル
ユーザー Konton7Konton7
提出日時 2019-05-23 23:06:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 446 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 11,936 KB
実行使用メモリ 80,712 KB
最終ジャッジ日時 2023-10-17 11:40:01
合計ジャッジ時間 16,795 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,477 ms
80,712 KB
testcase_01 AC 29 ms
10,080 KB
testcase_02 AC 28 ms
10,080 KB
testcase_03 AC 28 ms
10,080 KB
testcase_04 AC 28 ms
10,080 KB
testcase_05 AC 29 ms
10,080 KB
testcase_06 AC 28 ms
10,080 KB
testcase_07 AC 28 ms
10,080 KB
testcase_08 AC 28 ms
10,080 KB
testcase_09 AC 29 ms
10,080 KB
testcase_10 AC 28 ms
10,080 KB
testcase_11 AC 29 ms
10,084 KB
testcase_12 AC 29 ms
10,084 KB
testcase_13 AC 1,251 ms
79,148 KB
testcase_14 AC 1,230 ms
79,508 KB
testcase_15 AC 1,292 ms
80,672 KB
testcase_16 AC 1,581 ms
80,648 KB
testcase_17 TLE -
testcase_18 AC 1,330 ms
80,648 KB
testcase_19 AC 1,237 ms
80,648 KB
testcase_20 AC 1,257 ms
80,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline


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

for i in range(n):
	rotate_list[i] = input()

y, x = 0, 0


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


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