結果

問題 No.351 市松スライドパズル
ユーザー rlangevinrlangevin
提出日時 2023-01-25 12:30:23
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 789 ms / 2,000 ms
コード長 380 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 172,892 KB
最終ジャッジ日時 2023-09-09 00:06:25
合計ジャッジ時間 12,263 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 753 ms
171,308 KB
testcase_01 AC 70 ms
71,300 KB
testcase_02 AC 67 ms
71,372 KB
testcase_03 AC 68 ms
71,468 KB
testcase_04 AC 67 ms
71,252 KB
testcase_05 AC 67 ms
71,424 KB
testcase_06 AC 69 ms
71,328 KB
testcase_07 AC 67 ms
71,132 KB
testcase_08 AC 68 ms
71,532 KB
testcase_09 AC 68 ms
71,368 KB
testcase_10 AC 68 ms
71,352 KB
testcase_11 AC 70 ms
71,608 KB
testcase_12 AC 69 ms
71,324 KB
testcase_13 AC 766 ms
170,112 KB
testcase_14 AC 764 ms
170,356 KB
testcase_15 AC 775 ms
170,600 KB
testcase_16 AC 789 ms
172,892 KB
testcase_17 AC 760 ms
170,108 KB
testcase_18 AC 746 ms
170,152 KB
testcase_19 AC 775 ms
170,268 KB
testcase_20 AC 775 ms
170,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
N = int(input())
S, K = [None] * N, [None] * N
for i in range(N):
    S[i], K[i] = input().split()
    K[i] = int(K[i])

S.reverse()
K.reverse()
x, y = 0, 0
for i in range(N):
    if S[i] == "R" and K[i] == x:
        y = (y - 1)%W
    if S[i] == "C" and K[i] == y:
        x = (x - 1)%H
if (x + y) % 2:
    print("black")
else:
    print("white")
0