結果

問題 No.565 回転拡大
ユーザー pekempey
提出日時 2017-09-08 22:57:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 591 bytes
コンパイル時間 861 ms
コンパイル使用メモリ 80,244 KB
最終ジャッジ日時 2025-01-05 02:47:15
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

int main() {
  int r, k, h, w;
  cin >> r >> k >> h >> w;
  vector<string> c(h);
  for (int i = 0; i < h; i++) {
    cin >> c[i];
  }

  for (; r > 0; r -= 90) {
    vector<string> d(w, string(h, '\0'));
    for (int i = 0; i < w; i++) {
      for (int j = 0; j < h; j++) {
        d[i][j] = c[h - 1 - j][i];
      }
    }
    c = d;
    swap(h, w);
  }

  for (int i = 0; i < k * h; i++) {
    for (int j = 0; j < k * w; j++) {
      putchar(c[i / k][j / k]);
    }
    putchar('\n');
  }
}
0