結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 05:09:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 510 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 11,896 KB
実行使用メモリ 237,432 KB
最終ジャッジ日時 2023-10-25 06:38:46
合計ジャッジ時間 29,601 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 28 ms
10,092 KB
testcase_02 AC 29 ms
10,092 KB
testcase_03 AC 28 ms
10,092 KB
testcase_04 AC 28 ms
10,092 KB
testcase_05 AC 28 ms
10,092 KB
testcase_06 AC 29 ms
10,092 KB
testcase_07 AC 28 ms
10,092 KB
testcase_08 AC 29 ms
10,092 KB
testcase_09 AC 28 ms
10,092 KB
testcase_10 AC 28 ms
10,092 KB
testcase_11 AC 29 ms
10,100 KB
testcase_12 AC 29 ms
10,100 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
権限があれば一括ダウンロードができます

ソースコード

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