結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 05:07:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 823 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 81,720 KB
実行使用メモリ 240,564 KB
最終ジャッジ日時 2023-10-25 06:38:10
合計ジャッジ時間 9,939 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 790 ms
240,564 KB
testcase_01 AC 37 ms
53,384 KB
testcase_02 AC 37 ms
53,384 KB
testcase_03 AC 38 ms
53,384 KB
testcase_04 AC 37 ms
53,384 KB
testcase_05 AC 38 ms
53,384 KB
testcase_06 AC 37 ms
53,384 KB
testcase_07 AC 38 ms
53,384 KB
testcase_08 AC 38 ms
53,384 KB
testcase_09 AC 37 ms
53,384 KB
testcase_10 AC 38 ms
53,384 KB
testcase_11 AC 39 ms
53,384 KB
testcase_12 AC 39 ms
53,384 KB
testcase_13 AC 800 ms
238,132 KB
testcase_14 AC 804 ms
238,172 KB
testcase_15 AC 813 ms
238,296 KB
testcase_16 AC 823 ms
238,300 KB
testcase_17 AC 810 ms
238,292 KB
testcase_18 AC 797 ms
238,284 KB
testcase_19 AC 816 ms
238,308 KB
testcase_20 AC 820 ms
238,304 KB
権限があれば一括ダウンロードができます

ソースコード

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