結果

問題 No.351 市松スライドパズル
ユーザー TawaraTawara
提出日時 2016-03-11 23:00:35
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,542 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 850 ms
コンパイル使用メモリ 7,028 KB
実行使用メモリ 250,956 KB
最終ジャッジ日時 2023-10-25 07:12:00
合計ジャッジ時間 17,228 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,434 ms
203,400 KB
testcase_01 AC 10 ms
6,356 KB
testcase_02 AC 10 ms
6,356 KB
testcase_03 AC 11 ms
6,356 KB
testcase_04 AC 11 ms
6,356 KB
testcase_05 AC 10 ms
6,356 KB
testcase_06 AC 10 ms
6,356 KB
testcase_07 AC 10 ms
6,356 KB
testcase_08 AC 10 ms
6,356 KB
testcase_09 AC 11 ms
6,356 KB
testcase_10 AC 10 ms
6,356 KB
testcase_11 AC 10 ms
6,360 KB
testcase_12 AC 10 ms
6,360 KB
testcase_13 AC 1,503 ms
245,380 KB
testcase_14 AC 1,510 ms
246,732 KB
testcase_15 AC 1,517 ms
250,692 KB
testcase_16 AC 1,518 ms
250,956 KB
testcase_17 AC 1,498 ms
250,952 KB
testcase_18 AC 1,521 ms
250,956 KB
testcase_19 AC 1,542 ms
250,956 KB
testcase_20 AC 1,513 ms
250,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
def solve():
	H,W = map(int,stdin.readline().split())
	N = int(raw_input())
	SK = [stdin.readline().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"
solve()
0