結果

問題 No.351 市松スライドパズル
ユーザー pluto77pluto77
提出日時 2018-02-10 08:48:02
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 754 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 1,964 ms
コンパイル使用メモリ 77,512 KB
実行使用メモリ 254,936 KB
最終ジャッジ日時 2023-08-02 05:07:30
合計ジャッジ時間 12,817 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 637 ms
223,576 KB
testcase_01 AC 72 ms
76,500 KB
testcase_02 AC 70 ms
76,412 KB
testcase_03 AC 71 ms
76,520 KB
testcase_04 AC 72 ms
76,704 KB
testcase_05 AC 71 ms
76,716 KB
testcase_06 AC 72 ms
76,292 KB
testcase_07 AC 71 ms
76,288 KB
testcase_08 AC 74 ms
76,380 KB
testcase_09 AC 72 ms
76,140 KB
testcase_10 AC 71 ms
76,496 KB
testcase_11 AC 73 ms
76,432 KB
testcase_12 AC 73 ms
76,428 KB
testcase_13 AC 754 ms
253,852 KB
testcase_14 AC 743 ms
254,088 KB
testcase_15 AC 736 ms
254,704 KB
testcase_16 AC 752 ms
254,892 KB
testcase_17 AC 732 ms
252,736 KB
testcase_18 AC 732 ms
250,656 KB
testcase_19 AC 752 ms
254,528 KB
testcase_20 AC 738 ms
254,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki351

H,W=map(int,raw_input().split())
n=int(raw_input())
s=[];k=[]
for i in xrange(n):
 s1,k1=map(str,raw_input().split())
 s.append(s1)
 k.append(int(k1))
r=0;c=0
for i in xrange(n-1,-1,-1):
 if s[i]=='R':
  if k[i]==r:
   c=(c+W-1)%W
 else:
  if k[i]==c:
   r=(r+H-1)%H
if (r+c)%2:
 print 'black'
else:
 print 'white'
0