結果

問題 No.351 市松スライドパズル
ユーザー pluto77pluto77
提出日時 2018-02-10 08:48:02
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 738 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 1,224 ms
コンパイル使用メモリ 76,184 KB
実行使用メモリ 253,944 KB
最終ジャッジ日時 2024-04-20 05:08:58
合計ジャッジ時間 10,726 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 559 ms
222,616 KB
testcase_01 AC 65 ms
75,324 KB
testcase_02 AC 65 ms
75,564 KB
testcase_03 AC 66 ms
75,668 KB
testcase_04 AC 65 ms
75,300 KB
testcase_05 AC 65 ms
75,308 KB
testcase_06 AC 64 ms
75,544 KB
testcase_07 AC 65 ms
75,296 KB
testcase_08 AC 69 ms
75,288 KB
testcase_09 AC 70 ms
75,396 KB
testcase_10 AC 70 ms
75,652 KB
testcase_11 AC 68 ms
75,548 KB
testcase_12 AC 67 ms
75,532 KB
testcase_13 AC 677 ms
252,868 KB
testcase_14 AC 738 ms
253,192 KB
testcase_15 AC 652 ms
253,756 KB
testcase_16 AC 652 ms
253,944 KB
testcase_17 AC 666 ms
251,576 KB
testcase_18 AC 655 ms
249,284 KB
testcase_19 AC 661 ms
253,800 KB
testcase_20 AC 688 ms
253,736 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