結果

問題 No.351 市松スライドパズル
ユーザー tookunn_1213tookunn_1213
提出日時 2016-03-12 00:51:49
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 433 bytes
コンパイル時間 676 ms
コンパイル使用メモリ 7,068 KB
実行使用メモリ 77,080 KB
最終ジャッジ日時 2023-10-25 06:20:34
合計ジャッジ時間 25,713 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 11 ms
6,352 KB
testcase_02 AC 11 ms
6,352 KB
testcase_03 AC 11 ms
6,352 KB
testcase_04 AC 10 ms
6,352 KB
testcase_05 AC 11 ms
6,352 KB
testcase_06 AC 11 ms
6,352 KB
testcase_07 AC 11 ms
6,352 KB
testcase_08 AC 11 ms
6,352 KB
testcase_09 AC 11 ms
6,352 KB
testcase_10 AC 11 ms
6,352 KB
testcase_11 AC 11 ms
6,352 KB
testcase_12 AC 12 ms
6,352 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())
S = ['' for i in range(N)]
K = [0 for i in range(N)]
for i in range(N):
	s,k = raw_input().split()
	k = int(k)
	S[i],K[i] = s,k
R = 0
C = 0
for i in range(N - 1,-1,-1):
	if S[i] == 'R':
		if K[i] == R:
			if C == 0:
				C = W - 1
			else:
				C -= 1
	else:
		if K[i] == C:
			if R == 0:
				R = H - 1
			else:
				R -= 1
if (R + C) % 2 == 0:
	print 'white'
else:
	print 'black'
0