結果

問題 No.351 市松スライドパズル
ユーザー Snark86
提出日時 2016-03-11 23:33:00
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 281 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 77,116 KB
実行使用メモリ 165,592 KB
最終ジャッジ日時 2024-09-25 02:37:51
合計ジャッジ時間 5,003 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

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