結果

問題 No.351 市松スライドパズル
ユーザー Snark86Snark86
提出日時 2016-03-11 23:33:00
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 297 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 77,436 KB
実行使用メモリ 166,264 KB
最終ジャッジ日時 2023-10-25 07:18:42
合計ジャッジ時間 5,460 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 246 ms
163,376 KB
testcase_01 AC 73 ms
76,084 KB
testcase_02 AC 72 ms
76,084 KB
testcase_03 AC 73 ms
76,084 KB
testcase_04 AC 71 ms
76,084 KB
testcase_05 AC 70 ms
76,084 KB
testcase_06 AC 72 ms
76,084 KB
testcase_07 AC 72 ms
76,084 KB
testcase_08 AC 72 ms
76,084 KB
testcase_09 AC 70 ms
76,084 KB
testcase_10 AC 69 ms
76,084 KB
testcase_11 AC 70 ms
76,084 KB
testcase_12 AC 70 ms
76,084 KB
testcase_13 AC 291 ms
165,716 KB
testcase_14 AC 291 ms
165,756 KB
testcase_15 AC 296 ms
166,264 KB
testcase_16 AC 297 ms
166,260 KB
testcase_17 AC 272 ms
166,264 KB
testcase_18 AC 270 ms
166,260 KB
testcase_19 AC 286 ms
166,264 KB
testcase_20 AC 296 ms
166,264 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) == r:
		c = (c+W-1) % W
	elif a == "C" and int(b) == c:
		r = (r+H-1) % H

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