結果

問題 No.351 市松スライドパズル
ユーザー cielciel
提出日時 2016-03-13 22:31:34
言語 Crystal
(1.11.2)
結果
AC  
実行時間 379 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 16,893 ms
コンパイル使用メモリ 254,432 KB
実行使用メモリ 150,732 KB
最終ジャッジ日時 2023-09-13 09:04:37
合計ジャッジ時間 22,765 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 327 ms
133,108 KB
testcase_01 AC 3 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 3 ms
4,380 KB
testcase_04 AC 2 ms
4,460 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,392 KB
testcase_07 AC 2 ms
4,420 KB
testcase_08 AC 2 ms
4,412 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 3 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,392 KB
testcase_13 AC 379 ms
150,732 KB
testcase_14 AC 355 ms
145,776 KB
testcase_15 AC 355 ms
149,676 KB
testcase_16 AC 356 ms
149,624 KB
testcase_17 AC 345 ms
149,616 KB
testcase_18 AC 345 ms
149,572 KB
testcase_19 AC 351 ms
148,772 KB
testcase_20 AC 351 ms
148,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w=gets.not_nil!.split.map(&.to_i)
n=gets.not_nil!.to_i
r=c=0
n.times.map{gets.not_nil!.split}.to_a.reverse.each{|z|
	s,k=z
	r=(r+h-1)%h if s=="C"&&k.to_i==c
	c=(c+w-1)%w if s=="R"&&k.to_i==r
}
puts ["white","black"][(r+c)%2]
0