結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 05:40:11
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 615 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 77,100 KB
実行使用メモリ 239,572 KB
最終ジャッジ日時 2024-09-25 02:47:56
合計ジャッジ時間 8,474 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 595 ms
239,572 KB
testcase_01 AC 71 ms
75,684 KB
testcase_02 AC 70 ms
75,916 KB
testcase_03 AC 72 ms
75,268 KB
testcase_04 AC 70 ms
75,820 KB
testcase_05 AC 72 ms
75,416 KB
testcase_06 AC 71 ms
75,648 KB
testcase_07 AC 71 ms
75,396 KB
testcase_08 AC 70 ms
75,268 KB
testcase_09 AC 71 ms
75,400 KB
testcase_10 AC 72 ms
75,556 KB
testcase_11 AC 72 ms
75,528 KB
testcase_12 AC 73 ms
75,424 KB
testcase_13 AC 605 ms
238,216 KB
testcase_14 AC 605 ms
238,028 KB
testcase_15 AC 615 ms
238,260 KB
testcase_16 AC 613 ms
237,996 KB
testcase_17 AC 597 ms
238,156 KB
testcase_18 AC 599 ms
238,392 KB
testcase_19 AC 608 ms
238,440 KB
testcase_20 AC 606 ms
238,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    H, W = map(int, raw_input().split())
    N = int(raw_input())
    R = xrange(N)
    H, W, N = H-1, W-1, N-1
    S = [raw_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' 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