結果

問題 No.351 市松スライドパズル
ユーザー convexineq
提出日時 2021-01-18 05:03:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 864 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 82,324 KB
実行使用メモリ 250,836 KB
最終ジャッジ日時 2024-11-30 13:35:19
合計ジャッジ時間 11,611 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w = map(int,input().split())
n = int(input())
res = [input().split() for _ in range(n)]
x = y = 0
for a,b in res[::-1]:
    if a=="C" and y == int(b):
        x = (x-1)%h
    if a=="R" and x == int(b):
        y = (y-1)%w
print("black" if (x+y)%2 else "white")
0