結果

問題 No.351 市松スライドパズル
ユーザー kimiyuki
提出日時 2016-03-11 22:39:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 357 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 118,944 KB
最終ジャッジ日時 2024-09-25 00:59:31
合計ジャッジ時間 7,034 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 8 TLE * 4 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
h, w = map(int,input().split())
n = int(input())
ops = [(lambda s, k: (s, int(k)))(*input().split()) for i in range(n)]
y, x = 0, 0
for s, k in reversed(ops):
    if s == 'R':
        if y == k:
            x = (x - 1) % w
    elif s == 'C':
        if x == k:
            y = (y - 1) % h
print(y % 2 == x % 2 and 'white' or 'black')
0