結果

問題 No.351 市松スライドパズル
ユーザー LayCurseLayCurse
提出日時 2016-03-11 22:56:41
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 653 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 77,440 KB
実行使用メモリ 245,580 KB
最終ジャッジ日時 2023-10-25 07:10:35
合計ジャッジ時間 9,356 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 622 ms
245,296 KB
testcase_01 AC 74 ms
76,116 KB
testcase_02 AC 74 ms
76,116 KB
testcase_03 AC 73 ms
76,116 KB
testcase_04 AC 72 ms
76,116 KB
testcase_05 AC 72 ms
76,116 KB
testcase_06 AC 72 ms
76,116 KB
testcase_07 AC 73 ms
76,116 KB
testcase_08 AC 73 ms
76,116 KB
testcase_09 AC 73 ms
76,116 KB
testcase_10 AC 73 ms
76,116 KB
testcase_11 AC 73 ms
76,116 KB
testcase_12 AC 74 ms
76,116 KB
testcase_13 AC 653 ms
241,824 KB
testcase_14 AC 639 ms
242,776 KB
testcase_15 AC 647 ms
245,508 KB
testcase_16 AC 648 ms
245,580 KB
testcase_17 AC 638 ms
245,448 KB
testcase_18 AC 639 ms
245,332 KB
testcase_19 AC 649 ms
245,532 KB
testcase_20 AC 653 ms
245,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W = map(int,raw_input().split())
N = int(raw_input())
SK = [raw_input().split() for i in xrange(N)]
hx = hy = 0
for i in xrange(N-1,-1,-1):
    s,k = SK[i]
    k = int(k)
    if s == "R":
        if k == hy:
            hx = hx - 1
            if hx == -1:
                hx = W - 1
    else:
        if k == hx:
            hy = hy - 1
            if hy == -1:
                hy = H - 1
print "white" if (hx + hy) % 2 == 0 else "black"
0