結果

問題 No.351 市松スライドパズル
ユーザー TawaraTawara
提出日時 2016-03-11 22:46:13
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 306 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 7,036 KB
実行使用メモリ 250,972 KB
最終ジャッジ日時 2023-10-25 05:41:22
合計ジャッジ時間 28,520 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 11 ms
6,372 KB
testcase_02 AC 10 ms
6,372 KB
testcase_03 AC 12 ms
6,372 KB
testcase_04 AC 10 ms
6,372 KB
testcase_05 AC 11 ms
6,372 KB
testcase_06 AC 10 ms
6,372 KB
testcase_07 AC 11 ms
6,372 KB
testcase_08 AC 11 ms
6,372 KB
testcase_09 AC 11 ms
6,372 KB
testcase_10 AC 11 ms
6,372 KB
testcase_11 AC 11 ms
6,376 KB
testcase_12 AC 11 ms
6,376 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W = map(int,raw_input().split())
N = int(raw_input())
SK = [raw_input().split() for i in xrange(N)]
hx = hy = 0
for i in xrange(N-1,-1,-1):
	s,k = SK[i]
	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"
0