結果

問題 No.351 市松スライドパズル
ユーザー mkawa2mkawa2
提出日時 2020-03-19 00:34:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,318 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 10,976 KB
実行使用メモリ 243,516 KB
最終ジャッジ日時 2023-08-20 20:30:13
合計ジャッジ時間 14,582 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,002 ms
180,568 KB
testcase_01 AC 16 ms
7,800 KB
testcase_02 AC 15 ms
7,768 KB
testcase_03 AC 15 ms
8,012 KB
testcase_04 AC 16 ms
7,912 KB
testcase_05 AC 16 ms
7,800 KB
testcase_06 AC 16 ms
7,844 KB
testcase_07 AC 16 ms
7,768 KB
testcase_08 AC 15 ms
7,824 KB
testcase_09 AC 16 ms
7,800 KB
testcase_10 AC 16 ms
7,764 KB
testcase_11 AC 16 ms
7,904 KB
testcase_12 AC 16 ms
7,844 KB
testcase_13 AC 1,280 ms
237,832 KB
testcase_14 AC 1,288 ms
239,540 KB
testcase_15 AC 1,309 ms
243,208 KB
testcase_16 AC 1,314 ms
243,368 KB
testcase_17 AC 1,294 ms
243,516 KB
testcase_18 AC 1,318 ms
243,516 KB
testcase_19 AC 1,315 ms
243,352 KB
testcase_20 AC 1,307 ms
243,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline

def main():
    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 i==k:j=(j-1)%w
        if s=="C" and j==k:i=(i-1)%h
    if (i+j)&1:print("black")
    else:print("white")

main()
0