結果

問題 No.351 市松スライドパズル
ユーザー TawaraTawara
提出日時 2016-03-12 09:07:46
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 7,064 KB
実行使用メモリ 61,800 KB
最終ジャッジ日時 2023-10-25 06:42:47
合計ジャッジ時間 8,685 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 728 ms
61,800 KB
testcase_01 AC 10 ms
6,336 KB
testcase_02 AC 10 ms
6,336 KB
testcase_03 AC 11 ms
6,336 KB
testcase_04 AC 10 ms
6,336 KB
testcase_05 AC 10 ms
6,336 KB
testcase_06 WA -
testcase_07 AC 11 ms
6,336 KB
testcase_08 AC 10 ms
6,336 KB
testcase_09 WA -
testcase_10 AC 10 ms
6,336 KB
testcase_11 AC 11 ms
6,336 KB
testcase_12 AC 11 ms
6,336 KB
testcase_13 AC 704 ms
60,480 KB
testcase_14 AC 708 ms
60,760 KB
testcase_15 AC 722 ms
61,656 KB
testcase_16 AC 725 ms
61,800 KB
testcase_17 AC 716 ms
61,800 KB
testcase_18 AC 714 ms
61,800 KB
testcase_19 AC 715 ms
61,800 KB
testcase_20 AC 725 ms
61,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
def solve():
	IN = stdin.readlines()
	H,W = map(int,IN[0].split())
	N = int(IN[1])
	hx = hy = 0
	for i in xrange(N+1,2,-1):
		s,k = IN[i].split();
		k = int(k)
		if s == "R":
			if k == hy:
				hx = (hx - 1) % W
		else:
			if k == hx:
				hy = (hy - 1) % H
	print "white" if (hx + hy) % 2 == 0 else "black"
solve()
0