結果

問題 No.351 市松スライドパズル
ユーザー 👑 rin204rin204
提出日時 2022-01-20 03:27:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 827 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 251,524 KB
最終ジャッジ日時 2023-08-15 08:23:00
合計ジャッジ時間 11,243 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 827 ms
251,164 KB
testcase_01 AC 67 ms
71,164 KB
testcase_02 AC 63 ms
71,244 KB
testcase_03 AC 68 ms
71,236 KB
testcase_04 AC 68 ms
71,220 KB
testcase_05 AC 65 ms
71,292 KB
testcase_06 AC 66 ms
71,060 KB
testcase_07 AC 64 ms
71,036 KB
testcase_08 AC 66 ms
70,864 KB
testcase_09 AC 65 ms
71,220 KB
testcase_10 AC 66 ms
71,004 KB
testcase_11 AC 65 ms
71,240 KB
testcase_12 AC 64 ms
71,208 KB
testcase_13 AC 756 ms
247,368 KB
testcase_14 AC 729 ms
248,684 KB
testcase_15 AC 744 ms
251,360 KB
testcase_16 AC 772 ms
251,412 KB
testcase_17 AC 757 ms
251,524 KB
testcase_18 AC 739 ms
251,144 KB
testcase_19 AC 740 ms
251,112 KB
testcase_20 AC 739 ms
251,372 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 k == i:
        j = (j - 1) % w
    elif s == "C" and k == j:
        i = (i - 1) % h
if (i + j) % 2 == 0:
    print("white")
else:
    print("black")
        
0