結果

問題 No.351 市松スライドパズル
ユーザー gorugo30gorugo30
提出日時 2021-03-20 13:45:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 865 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 3,225 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 236,288 KB
最終ジャッジ日時 2023-08-13 06:07:55
合計ジャッジ時間 12,956 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 839 ms
233,936 KB
testcase_01 AC 73 ms
71,504 KB
testcase_02 AC 71 ms
71,240 KB
testcase_03 AC 72 ms
71,588 KB
testcase_04 AC 71 ms
71,200 KB
testcase_05 AC 72 ms
71,060 KB
testcase_06 AC 71 ms
71,316 KB
testcase_07 AC 71 ms
71,324 KB
testcase_08 AC 71 ms
71,560 KB
testcase_09 AC 71 ms
71,244 KB
testcase_10 AC 72 ms
71,560 KB
testcase_11 AC 73 ms
71,428 KB
testcase_12 AC 74 ms
71,240 KB
testcase_13 AC 827 ms
231,948 KB
testcase_14 AC 841 ms
231,972 KB
testcase_15 AC 865 ms
236,224 KB
testcase_16 AC 840 ms
236,288 KB
testcase_17 AC 810 ms
232,232 KB
testcase_18 AC 812 ms
232,012 KB
testcase_19 AC 836 ms
232,276 KB
testcase_20 AC 857 ms
236,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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