結果

問題 No.351 市松スライドパズル
ユーザー lloyzlloyz
提出日時 2023-02-23 16:06:02
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 1,334 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 246,880 KB
最終ジャッジ日時 2023-09-30 17:39:08
合計ジャッジ時間 12,806 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 737 ms
183,120 KB
testcase_01 AC 76 ms
71,276 KB
testcase_02 AC 70 ms
71,164 KB
testcase_03 AC 71 ms
71,328 KB
testcase_04 AC 73 ms
71,400 KB
testcase_05 AC 73 ms
71,324 KB
testcase_06 AC 74 ms
71,196 KB
testcase_07 AC 74 ms
71,520 KB
testcase_08 AC 75 ms
71,168 KB
testcase_09 AC 71 ms
71,200 KB
testcase_10 AC 72 ms
71,532 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 904 ms
243,960 KB
testcase_14 AC 853 ms
243,956 KB
testcase_15 AC 856 ms
246,880 KB
testcase_16 AC 863 ms
246,724 KB
testcase_17 AC 858 ms
242,756 KB
testcase_18 AC 847 ms
239,352 KB
testcase_19 AC 853 ms
244,052 KB
testcase_20 AC 861 ms
246,696 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) % h
    elif s == 'C' and cj == k:
        ci = (ci - 1) % w
if (ci + cj) % 2 == 0:
    print("white")
else:
    print("black")
0