結果
問題 |
No.351 市松スライドパズル
|
ユーザー |
|
提出日時 | 2018-10-05 02:48:32 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 787 ms / 2,000 ms |
コード長 | 423 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 74,716 KB |
最終ジャッジ日時 | 2024-10-12 12:27:53 |
合計ジャッジ時間 | 8,018 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 17 |
ソースコード
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=='C '+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")