結果

問題 No.351 市松スライドパズル
ユーザー lloyzlloyz
提出日時 2023-02-23 16:05:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 370 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 10,588 KB
実行使用メモリ 109,412 KB
最終ジャッジ日時 2023-09-30 17:38:54
合計ジャッジ時間 28,614 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 16 ms
7,980 KB
testcase_02 AC 15 ms
7,816 KB
testcase_03 AC 15 ms
7,792 KB
testcase_04 AC 15 ms
7,808 KB
testcase_05 AC 15 ms
7,728 KB
testcase_06 AC 15 ms
7,920 KB
testcase_07 AC 15 ms
7,768 KB
testcase_08 AC 16 ms
7,788 KB
testcase_09 AC 16 ms
7,912 KB
testcase_10 AC 15 ms
7,792 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
権限があれば一括ダウンロードができます

ソースコード

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