結果

問題 No.351 市松スライドパズル
ユーザー ebicochinealebicochineal
提出日時 2016-03-12 12:45:33
言語 Python2
(2.7.18)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 348 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 7,028 KB
実行使用メモリ 76,948 KB
最終ジャッジ日時 2023-10-25 08:01:36
合計ジャッジ時間 25,561 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 11 ms
6,416 KB
testcase_02 AC 11 ms
6,416 KB
testcase_03 AC 12 ms
6,416 KB
testcase_04 AC 11 ms
6,416 KB
testcase_05 AC 11 ms
6,416 KB
testcase_06 AC 11 ms
6,416 KB
testcase_07 AC 11 ms
6,416 KB
testcase_08 AC 11 ms
6,416 KB
testcase_09 AC 11 ms
6,416 KB
testcase_10 AC 11 ms
6,416 KB
testcase_11 AC 12 ms
6,416 KB
testcase_12 AC 11 ms
6,416 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
権限があれば一括ダウンロードができます

ソースコード

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