結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 12:32:35
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 484 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 77,348 KB
実行使用メモリ 125,216 KB
最終ジャッジ日時 2023-10-25 07:34:11
合計ジャッジ時間 7,219 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 473 ms
125,216 KB
testcase_01 AC 75 ms
76,112 KB
testcase_02 AC 76 ms
76,112 KB
testcase_03 AC 75 ms
76,112 KB
testcase_04 AC 75 ms
76,112 KB
testcase_05 AC 74 ms
76,112 KB
testcase_06 AC 74 ms
76,112 KB
testcase_07 AC 75 ms
76,112 KB
testcase_08 AC 75 ms
76,112 KB
testcase_09 AC 75 ms
76,112 KB
testcase_10 AC 75 ms
76,112 KB
testcase_11 AC 76 ms
76,112 KB
testcase_12 AC 76 ms
76,112 KB
testcase_13 AC 480 ms
124,688 KB
testcase_14 AC 480 ms
124,780 KB
testcase_15 AC 484 ms
125,036 KB
testcase_16 AC 482 ms
125,048 KB
testcase_17 AC 467 ms
124,968 KB
testcase_18 AC 470 ms
124,952 KB
testcase_19 AC 482 ms
125,024 KB
testcase_20 AC 477 ms
125,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, raw_input().split())
N = input()
M = N-1
S = ['' for x in range(N)]
K = [0 for x in range(N)]
for i in range(N):
    s = raw_input().split()
    S[i] = s[0]
    K[i] = int(s[1])
y=x=c=0
for i in range(N):
    c = M-i
    if S[c] == 'C':
        if K[c] == x: y = (y-1+H)%H
    else:
        if K[c] == y: x = (x-1+W)%W
print('black' if (y+x)%2 else 'white')
0