結果

問題 No.351 市松スライドパズル
ユーザー gorugo30gorugo30
提出日時 2021-03-20 13:46:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 588 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 780 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 235,724 KB
最終ジャッジ日時 2023-08-13 06:09:21
合計ジャッジ時間 9,839 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 588 ms
235,724 KB
testcase_01 AC 75 ms
71,476 KB
testcase_02 AC 75 ms
71,196 KB
testcase_03 AC 74 ms
71,172 KB
testcase_04 AC 75 ms
71,052 KB
testcase_05 AC 75 ms
71,056 KB
testcase_06 AC 75 ms
71,052 KB
testcase_07 AC 75 ms
71,048 KB
testcase_08 AC 73 ms
71,152 KB
testcase_09 AC 75 ms
71,172 KB
testcase_10 AC 76 ms
71,440 KB
testcase_11 AC 75 ms
71,364 KB
testcase_12 AC 76 ms
71,464 KB
testcase_13 AC 573 ms
231,936 KB
testcase_14 AC 578 ms
232,768 KB
testcase_15 AC 580 ms
232,932 KB
testcase_16 AC 576 ms
232,988 KB
testcase_17 AC 568 ms
232,916 KB
testcase_18 AC 550 ms
233,112 KB
testcase_19 AC 567 ms
233,004 KB
testcase_20 AC 576 ms
232,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

H, W = map(int, input().split())
N = int(input())
op = [list(input().split()) for i in range(N)]
op = op[::-1]
r, c = 0, 0
for i in range(N):
    if op[i][0] == "R" and int(op[i][1]) == r:
        c = (c - 1) % W
    if op[i][0] == "C" and int(op[i][1]) == c:
        r = (r - 1) % H
if (r + c) % 2:
    print("black")
else:
    print("white")
0