結果

問題 No.351 市松スライドパズル
ユーザー LayCurseLayCurse
提出日時 2016-03-11 23:12:38
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,050 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 960 ms
コンパイル使用メモリ 7,032 KB
実行使用メモリ 68,488 KB
最終ジャッジ日時 2023-10-25 07:14:41
合計ジャッジ時間 11,321 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,050 ms
65,664 KB
testcase_01 AC 10 ms
6,288 KB
testcase_02 AC 10 ms
6,288 KB
testcase_03 AC 10 ms
6,288 KB
testcase_04 AC 10 ms
6,288 KB
testcase_05 AC 10 ms
6,288 KB
testcase_06 AC 10 ms
6,288 KB
testcase_07 AC 10 ms
6,288 KB
testcase_08 AC 10 ms
6,288 KB
testcase_09 AC 10 ms
6,288 KB
testcase_10 AC 10 ms
6,288 KB
testcase_11 AC 10 ms
6,292 KB
testcase_12 AC 10 ms
6,292 KB
testcase_13 AC 925 ms
67,012 KB
testcase_14 AC 931 ms
67,316 KB
testcase_15 AC 957 ms
68,220 KB
testcase_16 AC 951 ms
68,484 KB
testcase_17 AC 943 ms
68,484 KB
testcase_18 AC 929 ms
68,484 KB
testcase_19 AC 930 ms
68,488 KB
testcase_20 AC 949 ms
68,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
ARR = sys.stdin.read().splitlines()
H,W = ARR[0].split()
H = int(H)
W = int(W)
N = ARR[1]
N = int(N)
hx = hy = 0
for i in xrange(N-1,-1,-1):
    s,k = ARR[i+2].split()
    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