結果

問題 No.351 市松スライドパズル
ユーザー しらっ亭しらっ亭
提出日時 2016-03-12 00:20:22
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 627 ms / 2,000 ms
コード長 491 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 77,436 KB
実行使用メモリ 239,652 KB
最終ジャッジ日時 2023-10-25 07:22:27
合計ジャッジ時間 8,896 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 615 ms
239,652 KB
testcase_01 AC 70 ms
76,068 KB
testcase_02 AC 68 ms
76,068 KB
testcase_03 AC 69 ms
76,068 KB
testcase_04 AC 69 ms
76,068 KB
testcase_05 AC 69 ms
76,068 KB
testcase_06 AC 68 ms
76,068 KB
testcase_07 AC 68 ms
76,068 KB
testcase_08 AC 70 ms
76,068 KB
testcase_09 AC 68 ms
76,068 KB
testcase_10 AC 68 ms
76,068 KB
testcase_11 AC 67 ms
76,068 KB
testcase_12 AC 69 ms
76,068 KB
testcase_13 AC 603 ms
238,404 KB
testcase_14 AC 591 ms
238,456 KB
testcase_15 AC 621 ms
238,576 KB
testcase_16 AC 627 ms
238,580 KB
testcase_17 AC 602 ms
238,496 KB
testcase_18 AC 608 ms
238,504 KB
testcase_19 AC 606 ms
238,580 KB
testcase_20 AC 619 ms
238,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    H, W = map(int, raw_input().split())
    N = int(input())

    A = [None] * N
    for i in xrange(N):
        A[i] = raw_input().split()

    x = y = 0
    for i in xrange(N - 1, -1, -1):
        s, k = A[i]
        if s == 'R':
            if int(k) == y:
                x = x - 1 if x else W - 1
        else:
            if int(k) == x:
                y = y - 1 if y else H - 1

    print('black' if ((x + y) % 2) else 'white')


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