結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 12:51:43
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 387 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 77,336 KB
実行使用メモリ 94,832 KB
最終ジャッジ日時 2023-10-25 07:35:44
合計ジャッジ時間 6,286 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 367 ms
94,724 KB
testcase_01 AC 76 ms
76,116 KB
testcase_02 AC 76 ms
76,116 KB
testcase_03 AC 76 ms
76,116 KB
testcase_04 AC 75 ms
76,116 KB
testcase_05 AC 75 ms
76,116 KB
testcase_06 AC 74 ms
76,116 KB
testcase_07 AC 75 ms
76,116 KB
testcase_08 AC 75 ms
76,116 KB
testcase_09 AC 76 ms
76,116 KB
testcase_10 AC 75 ms
76,116 KB
testcase_11 AC 76 ms
76,116 KB
testcase_12 AC 76 ms
76,116 KB
testcase_13 AC 375 ms
94,472 KB
testcase_14 AC 377 ms
94,568 KB
testcase_15 AC 384 ms
94,812 KB
testcase_16 AC 381 ms
94,832 KB
testcase_17 AC 370 ms
94,704 KB
testcase_18 AC 365 ms
94,704 KB
testcase_19 AC 379 ms
94,788 KB
testcase_20 AC 387 ms
94,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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