結果

問題 No.351 市松スライドパズル
ユーザー mkawa2mkawa2
提出日時 2020-03-19 00:34:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 447 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 86,768 KB
実行使用メモリ 251,172 KB
最終ジャッジ日時 2023-08-20 20:29:51
合計ジャッジ時間 6,467 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 407 ms
245,864 KB
testcase_01 AC 58 ms
71,348 KB
testcase_02 AC 60 ms
71,292 KB
testcase_03 AC 59 ms
71,356 KB
testcase_04 AC 57 ms
71,500 KB
testcase_05 AC 57 ms
71,340 KB
testcase_06 AC 61 ms
71,340 KB
testcase_07 AC 59 ms
71,284 KB
testcase_08 AC 58 ms
71,508 KB
testcase_09 AC 58 ms
71,296 KB
testcase_10 AC 60 ms
71,296 KB
testcase_11 AC 58 ms
71,104 KB
testcase_12 AC 59 ms
71,260 KB
testcase_13 AC 410 ms
242,400 KB
testcase_14 AC 422 ms
242,264 KB
testcase_15 AC 436 ms
250,916 KB
testcase_16 AC 439 ms
250,960 KB
testcase_17 AC 423 ms
250,872 KB
testcase_18 AC 434 ms
250,880 KB
testcase_19 AC 438 ms
251,172 KB
testcase_20 AC 447 ms
251,076 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