結果

問題 No.351 市松スライドパズル
ユーザー lloyzlloyz
提出日時 2023-02-23 16:07:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 849 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 247,052 KB
最終ジャッジ日時 2023-09-30 17:39:39
合計ジャッジ時間 11,011 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 700 ms
183,140 KB
testcase_01 AC 72 ms
71,384 KB
testcase_02 AC 71 ms
71,520 KB
testcase_03 AC 72 ms
71,192 KB
testcase_04 AC 72 ms
71,244 KB
testcase_05 AC 72 ms
71,276 KB
testcase_06 AC 72 ms
71,332 KB
testcase_07 AC 72 ms
71,452 KB
testcase_08 AC 72 ms
71,536 KB
testcase_09 AC 71 ms
71,400 KB
testcase_10 AC 70 ms
71,344 KB
testcase_11 AC 72 ms
71,336 KB
testcase_12 AC 73 ms
71,084 KB
testcase_13 AC 849 ms
244,016 KB
testcase_14 AC 796 ms
244,072 KB
testcase_15 AC 821 ms
246,700 KB
testcase_16 AC 796 ms
247,052 KB
testcase_17 AC 809 ms
242,664 KB
testcase_18 AC 789 ms
239,456 KB
testcase_19 AC 797 ms
243,872 KB
testcase_20 AC 821 ms
246,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
n = int(input())
P = []
for _ in range(n):
    s, k = input().split()
    P.append((s, int(k)))

ci, cj = 0, 0
for i in range(n - 1, -1, -1):
    s, k = P[i]
    if s == 'R' and ci == k:
        cj = (cj - 1) % w
    elif s == 'C' and cj == k:
        ci = (ci - 1) % h
if (ci + cj) % 2 == 0:
    print("white")
else:
    print("black")
0