結果

問題 No.351 市松スライドパズル
ユーザー cielciel
提出日時 2016-03-13 22:22:00
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,862 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 11,964 KB
実行使用メモリ 194,100 KB
最終ジャッジ日時 2023-10-26 03:37:48
合計ジャッジ時間 21,319 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,862 ms
194,064 KB
testcase_01 AC 82 ms
16,208 KB
testcase_02 AC 83 ms
16,208 KB
testcase_03 AC 83 ms
16,208 KB
testcase_04 AC 83 ms
16,208 KB
testcase_05 AC 82 ms
16,208 KB
testcase_06 AC 84 ms
16,208 KB
testcase_07 AC 84 ms
16,208 KB
testcase_08 AC 84 ms
16,208 KB
testcase_09 AC 83 ms
16,208 KB
testcase_10 AC 83 ms
16,208 KB
testcase_11 AC 84 ms
16,208 KB
testcase_12 AC 82 ms
16,208 KB
testcase_13 AC 1,827 ms
193,740 KB
testcase_14 AC 1,818 ms
193,836 KB
testcase_15 AC 1,852 ms
194,092 KB
testcase_16 AC 1,841 ms
194,100 KB
testcase_17 AC 1,827 ms
194,100 KB
testcase_18 AC 1,841 ms
194,100 KB
testcase_19 AC 1,839 ms
194,100 KB
testcase_20 AC 1,831 ms
194,100 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

H,W=gets.split.map(&:to_i)
N=gets.to_i
h=w=0
N.times.map{gets.split}.reverse.each{|(s,k)|
	h=(h+H-1)%H if s=="C"&&k.to_i==w
	w=(w+W-1)%W if s=="R"&&k.to_i==h
}
puts ["white","black"][(h+w)%2]
0