結果

問題 No.351 市松スライドパズル
ユーザー H3PO4H3PO4
提出日時 2020-06-25 15:28:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 381 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 109,404 KB
最終ジャッジ日時 2023-09-16 22:41:35
合計ジャッジ時間 28,411 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 16 ms
7,800 KB
testcase_02 AC 16 ms
7,732 KB
testcase_03 AC 16 ms
7,788 KB
testcase_04 AC 17 ms
7,784 KB
testcase_05 AC 16 ms
7,808 KB
testcase_06 AC 17 ms
7,752 KB
testcase_07 AC 17 ms
7,916 KB
testcase_08 AC 16 ms
7,828 KB
testcase_09 AC 17 ms
7,876 KB
testcase_10 AC 16 ms
7,800 KB
testcase_11 AC 17 ms
7,668 KB
testcase_12 AC 17 ms
7,720 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, input().split())
N = int(input())
Q = []
for _ in range(N):
    S, K = input().split()
    K = int(K)
    Q.append((S, K))

cur_x, cur_y = 0, 0
for s, k in reversed(Q):
    if s == 'R':
        if cur_x == k:
            cur_y = (cur_y - 1) % W
    else:
        if cur_y == k:
            cur_x = (cur_x - 1) % H
print('black' if (cur_x + cur_y) % 2 else 'white')
0