結果

問題 No.351 市松スライドパズル
ユーザー tookunn_1213tookunn_1213
提出日時 2016-03-12 00:13:10
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 450 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 211,692 KB
最終ジャッジ日時 2023-10-25 06:11:23
合計ジャッジ時間 9,499 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

H,W = map(int,raw_input().split())
N = int(raw_input())
tile = [[(i + j) % 2 for j in range(W)]for i in range(H)]
for i in range(N):
	S,K = raw_input().split()
	K = int(K)
	if S == 'R':
		right = tile[K][W - 1]
		for c in range(1,W):
			tile[K][c] = tile[K][c - 1]
		tile[K][0] = right
	else:
		bottom = tile[H - 1][K]
		for r in range(1,H):
			tile[r][K] = tile[r - 1][K]
		tile[0][K] = bottom
if tile[0][0] == 0:
	print 'white'
else:
	print 'black'
0