結果

問題 No.351 市松スライドパズル
ユーザー tkr182
提出日時 2018-10-05 02:47:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 423 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 74,900 KB
最終ジャッジ日時 2024-10-12 12:27:45
合計ジャッジ時間 8,021 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 6 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
h,w=map(int,input().split())
n=int(input())
d=sys.stdin.read().splitlines()
s=0
t=0
if h==w==1:
    print("white")
else:
    for k in d[::-1]:
            if k == 'R ' + str(t):
                    s= s-1 if s>0 else w-1
            elif k=='R '+str(s):         
                    t= t-1 if t>0 else h-1
    if (s%2==1 and t%2==0) or (s%2==0 and t%2==1):
        print("black")
    else:
        print("white")
0