結果

問題 No.351 市松スライドパズル
ユーザー Snark86Snark86
提出日時 2016-03-11 23:16:52
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,172 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 7,056 KB
実行使用メモリ 93,204 KB
最終ジャッジ日時 2023-10-25 07:16:51
合計ジャッジ時間 13,067 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,172 ms
93,204 KB
testcase_01 AC 11 ms
6,264 KB
testcase_02 AC 11 ms
6,264 KB
testcase_03 AC 11 ms
6,264 KB
testcase_04 AC 10 ms
6,264 KB
testcase_05 AC 11 ms
6,264 KB
testcase_06 AC 11 ms
6,264 KB
testcase_07 AC 11 ms
6,264 KB
testcase_08 AC 11 ms
6,264 KB
testcase_09 AC 11 ms
6,264 KB
testcase_10 AC 11 ms
6,264 KB
testcase_11 AC 11 ms
6,264 KB
testcase_12 AC 11 ms
6,264 KB
testcase_13 AC 1,084 ms
91,356 KB
testcase_14 AC 1,088 ms
91,884 KB
testcase_15 AC 1,108 ms
93,204 KB
testcase_16 AC 1,112 ms
93,204 KB
testcase_17 AC 1,093 ms
93,204 KB
testcase_18 AC 1,124 ms
93,204 KB
testcase_19 AC 1,153 ms
93,204 KB
testcase_20 AC 1,110 ms
93,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
lines = sys.stdin.readlines()
H, W = map(int,lines[0].strip().split())
r = 0
c = 0
N = len(lines) - 2
for i in range(N):
	a,b = lines[N+1-i].strip().split()
	if a == "R" and int(b) == c:
		r = (r+W-1) % W
	elif a == "C" and int(b) == r:
		c = (c+H-1) % H

color = ["white","black"]
print color[(r+c)%2]
0