結果

問題 No.351 市松スライドパズル
ユーザー kimiyukikimiyuki
提出日時 2016-03-11 22:39:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 357 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 11,980 KB
実行使用メモリ 111,220 KB
最終ジャッジ日時 2023-10-25 05:35:13
合計ジャッジ時間 26,880 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 28 ms
10,100 KB
testcase_02 AC 29 ms
10,100 KB
testcase_03 AC 28 ms
10,100 KB
testcase_04 AC 27 ms
10,100 KB
testcase_05 AC 27 ms
10,100 KB
testcase_06 AC 27 ms
10,100 KB
testcase_07 AC 28 ms
10,100 KB
testcase_08 AC 28 ms
10,100 KB
testcase_09 AC 29 ms
10,100 KB
testcase_10 AC 27 ms
10,100 KB
testcase_11 AC 28 ms
10,100 KB
testcase_12 AC 28 ms
10,100 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 #

#!/usr/bin/env python3
h, w = map(int,input().split())
n = int(input())
ops = [(lambda s, k: (s, int(k)))(*input().split()) for i in range(n)]
y, x = 0, 0
for s, k in reversed(ops):
    if s == 'R':
        if y == k:
            x = (x - 1) % w
    elif s == 'C':
        if x == k:
            y = (y - 1) % h
print(y % 2 == x % 2 and 'white' or 'black')
0