結果

問題 No.565 回転拡大
ユーザー tubo28tubo28
提出日時 2017-09-08 22:59:14
言語 Ruby
(3.3.0)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 702 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 11,504 KB
実行使用メモリ 15,340 KB
最終ジャッジ日時 2023-08-07 03:11:31
合計ジャッジ時間 4,241 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,296 KB
testcase_01 AC 80 ms
15,340 KB
testcase_02 AC 78 ms
15,076 KB
testcase_03 AC 79 ms
15,112 KB
testcase_04 AC 80 ms
15,072 KB
testcase_05 AC 78 ms
15,276 KB
testcase_06 AC 77 ms
15,324 KB
testcase_07 AC 78 ms
15,112 KB
testcase_08 AC 79 ms
15,152 KB
testcase_09 AC 80 ms
15,112 KB
testcase_10 AC 78 ms
15,172 KB
testcase_11 AC 78 ms
15,124 KB
testcase_12 AC 80 ms
15,068 KB
testcase_13 AC 80 ms
15,080 KB
testcase_14 AC 79 ms
15,284 KB
testcase_15 AC 79 ms
15,088 KB
testcase_16 AC 79 ms
15,168 KB
testcase_17 AC 78 ms
15,264 KB
testcase_18 AC 78 ms
15,068 KB
testcase_19 AC 79 ms
15,076 KB
testcase_20 AC 77 ms
15,072 KB
testcase_21 AC 78 ms
15,008 KB
testcase_22 AC 78 ms
15,072 KB
testcase_23 AC 77 ms
15,116 KB
testcase_24 AC 79 ms
15,000 KB
testcase_25 AC 78 ms
15,076 KB
testcase_26 AC 77 ms
15,140 KB
testcase_27 AC 78 ms
15,064 KB
testcase_28 AC 78 ms
15,168 KB
testcase_29 AC 78 ms
15,260 KB
testcase_30 AC 77 ms
15,000 KB
testcase_31 AC 77 ms
15,288 KB
testcase_32 AC 77 ms
15,168 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

$i = $<.read.split

while !$i.empty? do
  r, k, h, w = $i.shift(4).map(&:to_i)
  g = $i.shift(h).map { |l| l.split("") }

  if h < w
    while g.size < w
      g << ["*"] * w
    end
    h = w
  else
    while g[0].size < h
      h.times do |i|
        g[i] << "*"
      end
    end
    w = h
  end

  (r / 90).times do
    g = g.transpose
    h.times do |i|
      g[i].reverse!
    end
  end

  ans = Array.new(h*k) { Array.new(w*k, '.') }
  h.times do |i|
    w.times do |j|
      k.times do |ii|
        k.times do |jj|
          ans[i*k + ii][j*k + jj] = g[i][j]
        end
      end
    end
  end

  ans.each do |row|
    row.delete("*")
    if row.size > 0
      puts row.join
    end
  end
end
0