結果

問題 No.565 回転拡大
ユーザー simansiman
提出日時 2021-11-30 16:09:16
言語 Ruby
(3.3.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 11,148 KB
実行使用メモリ 15,368 KB
最終ジャッジ日時 2023-09-16 10:34:52
合計ジャッジ時間 3,861 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,308 KB
testcase_01 AC 79 ms
15,164 KB
testcase_02 AC 77 ms
15,280 KB
testcase_03 AC 75 ms
15,112 KB
testcase_04 AC 77 ms
15,196 KB
testcase_05 AC 78 ms
15,276 KB
testcase_06 AC 77 ms
15,032 KB
testcase_07 AC 76 ms
15,108 KB
testcase_08 AC 77 ms
15,112 KB
testcase_09 AC 75 ms
15,040 KB
testcase_10 AC 75 ms
15,092 KB
testcase_11 AC 78 ms
15,004 KB
testcase_12 AC 78 ms
15,116 KB
testcase_13 AC 77 ms
15,120 KB
testcase_14 AC 76 ms
15,272 KB
testcase_15 AC 75 ms
15,076 KB
testcase_16 AC 77 ms
15,272 KB
testcase_17 AC 77 ms
15,040 KB
testcase_18 AC 77 ms
15,144 KB
testcase_19 AC 78 ms
15,048 KB
testcase_20 AC 78 ms
15,112 KB
testcase_21 AC 76 ms
15,140 KB
testcase_22 AC 77 ms
15,332 KB
testcase_23 AC 75 ms
15,260 KB
testcase_24 AC 77 ms
15,368 KB
testcase_25 AC 77 ms
15,144 KB
testcase_26 AC 76 ms
15,080 KB
testcase_27 AC 76 ms
15,284 KB
testcase_28 AC 78 ms
15,284 KB
testcase_29 AC 75 ms
15,072 KB
testcase_30 AC 75 ms
15,284 KB
testcase_31 AC 75 ms
15,280 KB
testcase_32 AC 75 ms
15,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

R, K = gets.split.map(&:to_i)
H, W = gets.split.map(&:to_i)
C = H.times.map { gets.chomp }

nc = Array.new(H * K) { Array.new(W * K, '.') }

H.times do |y|
  W.times do |x|
    next if C[y][x] == '.'

    (K * y).upto(K * (y + 1) - 1) do |ny|
      (K * x).upto(K * (x + 1) - 1) do |nx|
        nc[ny][nx] = '#'
      end
    end
  end
end

nc = if R == 90
       nc.transpose.map(&:reverse)
     elsif R == 180
       nc.reverse.map(&:reverse)
     elsif R == 270
       nc.transpose.reverse
     else
       nc
     end

puts nc.map(&:join)
0