結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
15,184 KB
testcase_01 AC 81 ms
15,152 KB
testcase_02 WA -
testcase_03 AC 86 ms
15,168 KB
testcase_04 AC 83 ms
15,064 KB
testcase_05 AC 82 ms
15,100 KB
testcase_06 AC 83 ms
15,316 KB
testcase_07 AC 82 ms
15,380 KB
testcase_08 AC 82 ms
15,116 KB
testcase_09 AC 82 ms
15,196 KB
testcase_10 AC 82 ms
15,220 KB
testcase_11 AC 81 ms
15,092 KB
testcase_12 AC 82 ms
15,312 KB
testcase_13 AC 80 ms
15,316 KB
testcase_14 AC 80 ms
15,084 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 80 ms
15,180 KB
testcase_19 AC 82 ms
15,284 KB
testcase_20 AC 80 ms
15,296 KB
testcase_21 AC 81 ms
15,152 KB
testcase_22 AC 81 ms
15,328 KB
testcase_23 AC 80 ms
15,328 KB
testcase_24 WA -
testcase_25 AC 82 ms
15,140 KB
testcase_26 WA -
testcase_27 AC 81 ms
15,288 KB
testcase_28 AC 82 ms
15,332 KB
testcase_29 AC 81 ms
15,320 KB
testcase_30 AC 84 ms
15,120 KB
testcase_31 AC 81 ms
15,316 KB
testcase_32 AC 81 ms
15,104 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

  if r != 180
    (r / 90).times do
      g = g.transpose
      n.times do |i|
        g[i].reverse!
      end
    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
    end
  end
end
0