結果

問題 No.351 市松スライドパズル
ユーザー lloyz
提出日時 2023-02-23 16:06:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 501 ms
コンパイル使用メモリ 82,636 KB
実行使用メモリ 245,572 KB
最終ジャッジ日時 2024-07-23 11:19:35
合計ジャッジ時間 10,505 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 15 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
n = int(input())
P = []
for _ in range(n):
    s, k = input().split()
    P.append((s, int(k)))

ci, cj = 0, 0
for i in range(n - 1, -1, -1):
    s, k = P[i]
    if s == 'R' and ci == k:
        cj = (cj - 1) % h
    elif s == 'C' and cj == k:
        ci = (ci - 1) % w
if (ci + cj) % 2 == 0:
    print("white")
else:
    print("black")
0