結果

問題 No.351 市松スライドパズル
ユーザー rpy3cpprpy3cpp
提出日時 2016-03-14 12:36:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 332 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 88,408 KB
最終ジャッジ日時 2023-10-26 04:18:55
合計ジャッジ時間 24,738 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 30 ms
10,120 KB
testcase_02 AC 30 ms
10,120 KB
testcase_03 AC 30 ms
10,120 KB
testcase_04 AC 29 ms
10,120 KB
testcase_05 AC 29 ms
10,120 KB
testcase_06 AC 29 ms
10,120 KB
testcase_07 AC 29 ms
10,120 KB
testcase_08 AC 29 ms
10,120 KB
testcase_09 AC 29 ms
10,120 KB
testcase_10 AC 29 ms
10,120 KB
testcase_11 WA -
testcase_12 WA -
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, input().split())
N = int(input())
SK = [input() for i in range(N)]
r = 0
c = 0
for sk in SK[::-1]:
    s, k = sk.split()
    k = int(k)
    if s == "R":
        if k == r:
            c = (c - 1) % H
    else:
        if k == c:
            r = (r - 1) % W
if (r + c) & 1:
    print("black")
else:
    print("white")
0