結果

問題 No.565 回転拡大
ユーザー tubo28tubo28
提出日時 2017-09-08 23:09:27
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 728 bytes
コンパイル時間 214 ms
コンパイル使用メモリ 11,252 KB
実行使用メモリ 15,432 KB
最終ジャッジ日時 2023-08-07 03:18:50
合計ジャッジ時間 4,113 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 79 ms
15,156 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 80 ms
15,164 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 80 ms
15,240 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 79 ms
15,180 KB
testcase_28 WA -
testcase_29 AC 80 ms
15,388 KB
testcase_30 AC 79 ms
15,340 KB
testcase_31 WA -
testcase_32 AC 80 ms
15,332 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("") }

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

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

  ans = Array.new(n*k) { Array.new(w*k, '.') }
  n.times do |i|
    n.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.reverse
    end
  end
end
0