結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 07:09:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 802 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 1,301 ms
コンパイル使用メモリ 81,384 KB
実行使用メモリ 240,476 KB
最終ジャッジ日時 2023-10-25 06:41:13
合計ジャッジ時間 10,560 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 758 ms
240,476 KB
testcase_01 AC 36 ms
53,316 KB
testcase_02 AC 35 ms
53,316 KB
testcase_03 AC 36 ms
53,316 KB
testcase_04 AC 35 ms
53,316 KB
testcase_05 AC 36 ms
53,316 KB
testcase_06 AC 36 ms
53,316 KB
testcase_07 AC 36 ms
53,316 KB
testcase_08 AC 35 ms
53,316 KB
testcase_09 AC 37 ms
53,316 KB
testcase_10 AC 36 ms
53,316 KB
testcase_11 AC 37 ms
53,316 KB
testcase_12 AC 38 ms
53,316 KB
testcase_13 AC 776 ms
238,024 KB
testcase_14 AC 778 ms
238,076 KB
testcase_15 AC 778 ms
238,204 KB
testcase_16 AC 787 ms
238,200 KB
testcase_17 AC 772 ms
238,168 KB
testcase_18 AC 779 ms
238,200 KB
testcase_19 AC 802 ms
238,204 KB
testcase_20 AC 785 ms
238,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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