結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 369 ms
94,772 KB
testcase_01 AC 75 ms
76,112 KB
testcase_02 AC 74 ms
76,112 KB
testcase_03 AC 75 ms
76,112 KB
testcase_04 AC 74 ms
76,112 KB
testcase_05 AC 74 ms
76,112 KB
testcase_06 AC 75 ms
76,112 KB
testcase_07 AC 74 ms
76,112 KB
testcase_08 AC 74 ms
76,112 KB
testcase_09 AC 75 ms
76,112 KB
testcase_10 AC 75 ms
76,112 KB
testcase_11 AC 74 ms
76,112 KB
testcase_12 AC 74 ms
76,112 KB
testcase_13 AC 374 ms
94,480 KB
testcase_14 AC 378 ms
94,576 KB
testcase_15 AC 383 ms
94,832 KB
testcase_16 AC 381 ms
94,840 KB
testcase_17 AC 369 ms
94,752 KB
testcase_18 AC 369 ms
94,732 KB
testcase_19 AC 378 ms
94,804 KB
testcase_20 AC 380 ms
94,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, raw_input().split())
N = input()
S = [0 for x in range(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