結果

問題 No.351 市松スライドパズル
ユーザー takakintakakin
提出日時 2020-06-10 23:59:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 717 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 275,556 KB
最終ジャッジ日時 2023-09-06 00:52:02
合計ジャッジ時間 10,492 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 682 ms
274,788 KB
testcase_01 AC 65 ms
71,368 KB
testcase_02 AC 62 ms
71,364 KB
testcase_03 AC 64 ms
71,176 KB
testcase_04 AC 65 ms
71,368 KB
testcase_05 AC 66 ms
71,400 KB
testcase_06 AC 64 ms
71,372 KB
testcase_07 AC 65 ms
71,168 KB
testcase_08 AC 65 ms
71,368 KB
testcase_09 AC 64 ms
71,420 KB
testcase_10 AC 64 ms
71,284 KB
testcase_11 AC 64 ms
71,624 KB
testcase_12 AC 65 ms
71,556 KB
testcase_13 AC 639 ms
261,504 KB
testcase_14 AC 631 ms
261,680 KB
testcase_15 AC 717 ms
275,556 KB
testcase_16 AC 704 ms
275,280 KB
testcase_17 AC 714 ms
275,496 KB
testcase_18 AC 700 ms
275,228 KB
testcase_19 AC 702 ms
275,460 KB
testcase_20 AC 677 ms
275,204 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-=1
    if y<0:
      y+=w
  if s=="C" and y==int(k):
    x-=1
    if x<0:
      x+=h
if (x+y)%2==0:
  print("white")
else:
  print("black")
0