結果

問題 No.351 市松スライドパズル
ユーザー urutomurutom
提出日時 2019-04-13 14:40:47
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,770 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 11,520 KB
実行使用メモリ 194,132 KB
最終ジャッジ日時 2023-10-13 14:19:14
合計ジャッジ時間 21,621 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,765 ms
194,132 KB
testcase_01 AC 82 ms
15,084 KB
testcase_02 AC 82 ms
15,216 KB
testcase_03 AC 82 ms
15,044 KB
testcase_04 AC 82 ms
15,184 KB
testcase_05 AC 81 ms
15,100 KB
testcase_06 AC 83 ms
15,040 KB
testcase_07 AC 81 ms
14,996 KB
testcase_08 AC 82 ms
15,048 KB
testcase_09 AC 81 ms
15,048 KB
testcase_10 AC 81 ms
15,312 KB
testcase_11 AC 83 ms
14,996 KB
testcase_12 AC 82 ms
15,208 KB
testcase_13 AC 1,740 ms
193,408 KB
testcase_14 AC 1,742 ms
194,056 KB
testcase_15 AC 1,752 ms
193,140 KB
testcase_16 AC 1,767 ms
194,048 KB
testcase_17 AC 1,770 ms
193,580 KB
testcase_18 AC 1,756 ms
194,036 KB
testcase_19 AC 1,766 ms
193,508 KB
testcase_20 AC 1,766 ms
194,100 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h,w=gets.split.map(&:to_i)
x=y=0
operations=gets.to_i.times.map{gets.split}
operations.reverse.each{|c,k|
  if c==?R
    y=(y-1)%w if k.to_i==x
  else
    x=(x-1)%h if k.to_i==y
  end
}

puts (x+y).odd? ? "black" : "white"
0