結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 13:34:50
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 421 ms / 2,000 ms
コード長 319 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 77,456 KB
実行使用メモリ 118,848 KB
最終ジャッジ日時 2023-10-25 08:05:03
合計ジャッジ時間 6,540 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 397 ms
118,464 KB
testcase_01 AC 72 ms
76,100 KB
testcase_02 AC 73 ms
76,100 KB
testcase_03 AC 72 ms
76,100 KB
testcase_04 AC 73 ms
76,100 KB
testcase_05 AC 75 ms
76,100 KB
testcase_06 AC 74 ms
76,100 KB
testcase_07 AC 74 ms
76,100 KB
testcase_08 AC 74 ms
76,100 KB
testcase_09 AC 73 ms
76,100 KB
testcase_10 AC 75 ms
76,100 KB
testcase_11 AC 75 ms
76,100 KB
testcase_12 AC 73 ms
76,100 KB
testcase_13 AC 415 ms
117,976 KB
testcase_14 AC 416 ms
117,964 KB
testcase_15 AC 421 ms
118,784 KB
testcase_16 AC 419 ms
118,808 KB
testcase_17 AC 402 ms
118,572 KB
testcase_18 AC 402 ms
118,608 KB
testcase_19 AC 416 ms
118,560 KB
testcase_20 AC 418 ms
118,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, raw_input().split())
N = input()
S = [""]*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