結果

問題 No.351 市松スライドパズル
ユーザー dangodango
提出日時 2023-06-13 21:01:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 880 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 86,688 KB
実行使用メモリ 251,648 KB
最終ジャッジ日時 2023-09-04 07:57:01
合計ジャッジ時間 12,960 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 853 ms
251,124 KB
testcase_01 AC 78 ms
71,220 KB
testcase_02 AC 76 ms
71,136 KB
testcase_03 AC 77 ms
70,940 KB
testcase_04 AC 80 ms
70,812 KB
testcase_05 AC 75 ms
71,012 KB
testcase_06 AC 77 ms
71,292 KB
testcase_07 AC 75 ms
71,140 KB
testcase_08 AC 76 ms
71,060 KB
testcase_09 AC 76 ms
70,864 KB
testcase_10 AC 76 ms
70,940 KB
testcase_11 AC 78 ms
70,940 KB
testcase_12 AC 76 ms
70,812 KB
testcase_13 AC 857 ms
247,412 KB
testcase_14 AC 859 ms
248,816 KB
testcase_15 AC 866 ms
251,648 KB
testcase_16 AC 880 ms
251,552 KB
testcase_17 AC 858 ms
251,308 KB
testcase_18 AC 851 ms
251,032 KB
testcase_19 AC 866 ms
251,280 KB
testcase_20 AC 857 ms
251,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int,input().split())
N = int(input())
SK = [input().split() for _ in range(N)]
I = J = 0
for S, K in SK[::-1]:
    K = int(K)
    if S == "R" and I == K:
        J = (J - 1) % W
    if S == "C" and J == K:
        I = (I - 1) % H
if (I + J) & 1:
    print("black")
else:
    print("white")
0