結果

問題 No.351 市松スライドパズル
ユーザー JunOnuma
提出日時 2017-05-23 18:26:52
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 339 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 289,152 KB
最終ジャッジ日時 2024-09-19 11:45:34
合計ジャッジ時間 7,626 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 8 TLE * 5 -- * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w = map(int, raw_input().split())
k = int(raw_input())
l = [raw_input().split() for _ in range(k)]
x = 0
y = 0
i = k-1
while i >= 0:
    c, j = l[i]
    if c == 'R' and y == int(j):
        x = (x+w-1) % w
    elif c == 'C' and x == int(j):
        y = (y+h-1) % h
    i -= 1
if (x+y) % 2 == 0:
    print 'white'
else:
    print 'black'
0