結果

問題 No.351 市松スライドパズル
ユーザー takakintakakin
提出日時 2020-06-11 00:00:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 764 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 847 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 275,516 KB
最終ジャッジ日時 2023-09-06 00:53:45
合計ジャッジ時間 10,318 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 678 ms
274,972 KB
testcase_01 AC 66 ms
71,344 KB
testcase_02 AC 65 ms
71,440 KB
testcase_03 AC 64 ms
71,332 KB
testcase_04 AC 67 ms
71,408 KB
testcase_05 AC 68 ms
71,564 KB
testcase_06 AC 66 ms
71,656 KB
testcase_07 AC 67 ms
71,336 KB
testcase_08 AC 65 ms
71,436 KB
testcase_09 AC 63 ms
71,120 KB
testcase_10 AC 65 ms
71,368 KB
testcase_11 AC 63 ms
71,176 KB
testcase_12 AC 65 ms
71,388 KB
testcase_13 AC 679 ms
261,892 KB
testcase_14 AC 688 ms
262,044 KB
testcase_15 AC 688 ms
275,276 KB
testcase_16 AC 697 ms
275,332 KB
testcase_17 AC 707 ms
275,244 KB
testcase_18 AC 747 ms
275,516 KB
testcase_19 AC 764 ms
275,332 KB
testcase_20 AC 726 ms
275,452 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
  if s=="C" and y==int(k):
    x=(x-1)%h
if (x+y)%2==0:
  print("white")
else:
  print("black")
0