結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 13:33:15
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 504 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 77,404 KB
実行使用メモリ 135,156 KB
最終ジャッジ日時 2023-10-25 08:04:55
合計ジャッジ時間 7,280 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 473 ms
134,844 KB
testcase_01 AC 73 ms
76,100 KB
testcase_02 AC 72 ms
76,100 KB
testcase_03 AC 73 ms
76,100 KB
testcase_04 AC 73 ms
76,100 KB
testcase_05 AC 74 ms
76,100 KB
testcase_06 AC 75 ms
76,100 KB
testcase_07 AC 74 ms
76,100 KB
testcase_08 AC 75 ms
76,100 KB
testcase_09 AC 74 ms
76,100 KB
testcase_10 AC 73 ms
76,100 KB
testcase_11 AC 74 ms
76,100 KB
testcase_12 AC 75 ms
76,100 KB
testcase_13 AC 485 ms
133,908 KB
testcase_14 AC 490 ms
134,224 KB
testcase_15 AC 496 ms
135,112 KB
testcase_16 AC 504 ms
135,156 KB
testcase_17 AC 472 ms
134,896 KB
testcase_18 AC 466 ms
134,892 KB
testcase_19 AC 483 ms
135,080 KB
testcase_20 AC 490 ms
135,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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