結果

問題 No.351 市松スライドパズル
コンテスト
ユーザー ebicochineal
提出日時 2016-03-12 05:07:11
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 847 ms / 2,000 ms
コード長 510 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 180 ms
コンパイル使用メモリ 85,120 KB
実行使用メモリ 244,608 KB
最終ジャッジ日時 2026-04-12 05:37:52
合計ジャッジ時間 9,044 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def main():
    H, W = map(int, input().split())
    H, W = H-1, W-1
    N = int(input())
    R = range(N)
    S = [input().split() for _ in R]
    y, x = [0, 0]
    for i in R:
        j = N-i-1
        a = int(S[j][1])
        s = S[j][0]
        if s == 'C' and x == a:
            b = y-1
            if b<0:b=H
            y = b
        elif s == 'R' and y == a:
            b = x-1
            if b<0:b=W
            x = b
    print('black' if (y+x)%2 else 'white')

if __name__ == '__main__':
    main()
0