結果

問題 No.351 市松スライドパズル
ユーザー code-devocode-devo
提出日時 2016-03-11 22:47:14
言語 Ruby
(3.3.0)
結果
MLE  
実行時間 -
コード長 363 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 11,960 KB
実行使用メモリ 567,520 KB
最終ジャッジ日時 2023-10-25 05:41:41
合計ジャッジ時間 8,023 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,029 ms
20,664 KB
testcase_01 AC 86 ms
16,208 KB
testcase_02 AC 87 ms
16,208 KB
testcase_03 AC 87 ms
16,204 KB
testcase_04 AC 87 ms
16,208 KB
testcase_05 AC 87 ms
16,208 KB
testcase_06 AC 83 ms
16,208 KB
testcase_07 AC 83 ms
16,208 KB
testcase_08 AC 86 ms
16,208 KB
testcase_09 AC 85 ms
16,208 KB
testcase_10 AC 85 ms
16,208 KB
testcase_11 AC 87 ms
16,208 KB
testcase_12 AC 88 ms
16,208 KB
testcase_13 MLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h, w = gets.split.map(&:to_i)
map = Array.new(h){|y| Array.new(w){|x| (x + y).even? ? "white" : "black"}}

gets
while line = gets do
  s, k = line.split
  k = k.to_i

  case s
  when "R" then
    map[k].rotate!(-1)
  when "C" then
    tmp = map[-1][k]
    (h-1).downto(1) do |y|
      map[y][k] = map[y-1][k]
    end
    map[0][k] = tmp
  end
end

puts map[0][0]
0