結果

問題 No.351 市松スライドパズル
ユーザー ebicochineal
提出日時 2016-03-12 05:09:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 510 bytes
コンパイル時間 761 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 159,872 KB
最終ジャッジ日時 2024-09-25 02:02:21
合計ジャッジ時間 30,592 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 8 TLE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

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