結果

問題 No.351 市松スライドパズル
ユーザー takakintakakin
提出日時 2020-06-10 23:55:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 898 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 815 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 328,452 KB
最終ジャッジ日時 2023-09-06 00:47:43
合計ジャッジ時間 11,415 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 838 ms
321,928 KB
testcase_01 AC 77 ms
71,108 KB
testcase_02 AC 68 ms
71,116 KB
testcase_03 AC 71 ms
71,352 KB
testcase_04 AC 72 ms
71,312 KB
testcase_05 AC 71 ms
71,176 KB
testcase_06 AC 69 ms
71,108 KB
testcase_07 AC 74 ms
71,288 KB
testcase_08 AC 71 ms
71,120 KB
testcase_09 AC 73 ms
71,108 KB
testcase_10 AC 74 ms
71,312 KB
testcase_11 AC 76 ms
71,092 KB
testcase_12 AC 71 ms
71,384 KB
testcase_13 AC 881 ms
320,528 KB
testcase_14 AC 883 ms
321,064 KB
testcase_15 AC 898 ms
328,092 KB
testcase_16 AC 893 ms
328,004 KB
testcase_17 AC 857 ms
328,388 KB
testcase_18 AC 885 ms
328,452 KB
testcase_19 AC 882 ms
328,320 KB
testcase_20 AC 884 ms
328,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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