結果

問題 No.351 市松スライドパズル
ユーザー しらっ亭しらっ亭
提出日時 2016-03-12 00:18:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 850 ms / 2,000 ms
コード長 481 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 240,720 KB
最終ジャッジ日時 2023-10-25 06:15:33
合計ジャッジ時間 10,562 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 823 ms
240,720 KB
testcase_01 AC 38 ms
53,492 KB
testcase_02 AC 38 ms
53,492 KB
testcase_03 AC 39 ms
53,492 KB
testcase_04 AC 37 ms
53,492 KB
testcase_05 AC 38 ms
53,492 KB
testcase_06 AC 38 ms
53,492 KB
testcase_07 AC 38 ms
53,492 KB
testcase_08 AC 38 ms
53,492 KB
testcase_09 AC 38 ms
53,492 KB
testcase_10 AC 38 ms
53,492 KB
testcase_11 AC 39 ms
53,492 KB
testcase_12 AC 40 ms
53,492 KB
testcase_13 AC 841 ms
238,280 KB
testcase_14 AC 839 ms
238,316 KB
testcase_15 AC 850 ms
238,456 KB
testcase_16 AC 849 ms
238,456 KB
testcase_17 AC 828 ms
238,448 KB
testcase_18 AC 818 ms
238,440 KB
testcase_19 AC 840 ms
238,460 KB
testcase_20 AC 838 ms
238,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    A = [None] * N
    for i in range(N):
        A[i] = input().split()

    x = y = 0
    for i in range(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