結果

問題 No.351 市松スライドパズル
ユーザー tabataba
提出日時 2016-04-14 19:59:48
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 663 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 652 ms
コンパイル使用メモリ 77,444 KB
実行使用メモリ 247,800 KB
最終ジャッジ日時 2023-10-25 07:44:58
合計ジャッジ時間 9,360 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 642 ms
247,800 KB
testcase_01 AC 76 ms
76,204 KB
testcase_02 AC 76 ms
76,204 KB
testcase_03 AC 75 ms
76,204 KB
testcase_04 AC 75 ms
76,204 KB
testcase_05 AC 75 ms
76,204 KB
testcase_06 AC 75 ms
76,204 KB
testcase_07 AC 76 ms
76,204 KB
testcase_08 AC 76 ms
76,204 KB
testcase_09 AC 76 ms
76,204 KB
testcase_10 AC 75 ms
76,204 KB
testcase_11 AC 76 ms
76,204 KB
testcase_12 AC 75 ms
76,204 KB
testcase_13 AC 650 ms
246,528 KB
testcase_14 AC 658 ms
246,616 KB
testcase_15 AC 663 ms
246,860 KB
testcase_16 AC 661 ms
246,880 KB
testcase_17 AC 644 ms
246,636 KB
testcase_18 AC 640 ms
246,636 KB
testcase_19 AC 652 ms
246,836 KB
testcase_20 AC 657 ms
246,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w=map(int,raw_input().split())
n=input()
x=0
y=0
for sk in[raw_input().split()for i in xrange(n)][::-1]:
	#print sk,x,y
	k=int(sk[1])
	if ord(sk[0])==82:
		if y==k:
			x=(x-1+w)%w
	elif x==k:
		y=(y-1+h)%h
print["white","black"][x&1^y&1]
0