結果

問題 No.351 市松スライドパズル
ユーザー takakintakakin
提出日時 2020-06-11 00:01:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,031 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,832 KB
実行使用メモリ 149,392 KB
最終ジャッジ日時 2023-09-06 00:55:07
合計ジャッジ時間 12,059 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 978 ms
86,412 KB
testcase_01 AC 15 ms
7,884 KB
testcase_02 AC 15 ms
7,880 KB
testcase_03 AC 15 ms
7,836 KB
testcase_04 AC 16 ms
7,768 KB
testcase_05 AC 15 ms
7,880 KB
testcase_06 AC 16 ms
7,824 KB
testcase_07 AC 16 ms
7,896 KB
testcase_08 AC 16 ms
7,968 KB
testcase_09 AC 16 ms
7,828 KB
testcase_10 AC 16 ms
7,972 KB
testcase_11 AC 16 ms
7,820 KB
testcase_12 AC 15 ms
7,820 KB
testcase_13 AC 995 ms
146,260 KB
testcase_14 AC 1,019 ms
147,052 KB
testcase_15 AC 1,026 ms
149,392 KB
testcase_16 AC 1,024 ms
149,364 KB
testcase_17 AC 998 ms
149,216 KB
testcase_18 AC 1,004 ms
149,356 KB
testcase_19 AC 1,031 ms
149,296 KB
testcase_20 AC 1,019 ms
149,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
h,w=map(int,input().split())
n=int(input())
S=[tuple(input().split()) for _ in range(n)]
x,y=0,0
for s,k in S[::-1]:
  if s=="R" and x==int(k):
    y=(y-1)%w
  elif s=="C" and y==int(k):
    x=(x-1)%h
if (x+y)%2==0:
  print("white")
else:
  print("black")
0