結果

問題 No.351 市松スライドパズル
ユーザー rpy3cpprpy3cpp
提出日時 2016-03-14 12:48:58
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 476 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 748 ms
コンパイル使用メモリ 77,516 KB
実行使用メモリ 119,320 KB
最終ジャッジ日時 2023-10-25 07:41:09
合計ジャッジ時間 7,727 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 428 ms
118,956 KB
testcase_01 AC 74 ms
76,184 KB
testcase_02 AC 73 ms
76,184 KB
testcase_03 AC 74 ms
76,184 KB
testcase_04 AC 74 ms
76,184 KB
testcase_05 AC 73 ms
76,184 KB
testcase_06 AC 75 ms
76,184 KB
testcase_07 AC 73 ms
76,184 KB
testcase_08 AC 73 ms
76,184 KB
testcase_09 AC 74 ms
76,184 KB
testcase_10 AC 74 ms
76,184 KB
testcase_11 AC 88 ms
76,184 KB
testcase_12 AC 75 ms
76,184 KB
testcase_13 AC 476 ms
118,336 KB
testcase_14 AC 455 ms
118,536 KB
testcase_15 AC 454 ms
119,208 KB
testcase_16 AC 457 ms
119,244 KB
testcase_17 AC 441 ms
119,068 KB
testcase_18 AC 439 ms
118,980 KB
testcase_19 AC 447 ms
119,028 KB
testcase_20 AC 454 ms
119,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

input = raw_input
range = xrange

H, W = map(int, input().split())
N = int(input())
SK = [input() for i in range(N)]
SK.reverse()
r = 0
c = 0
for sk in SK:
    s, k = sk.split()
    k = int(k)
    if s == "R":
        if k == r:
            c = (c - 1) % W
    else:
        if k == c:
            r = (r - 1) % H
if (r + c) & 1:
    print("black")
else:
    print("white")
0