結果

問題 No.565 回転拡大
ユーザー 0w10w1
提出日時 2017-09-09 16:11:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 947 bytes
コンパイル時間 2,343 ms
コンパイル使用メモリ 200,200 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 00:18:19
合計ジャッジ時間 2,853 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
5,248 KB
testcase_02 WA -
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 2 ms
5,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
5,376 KB
testcase_24 WA -
testcase_25 AC 2 ms
5,376 KB
testcase_26 WA -
testcase_27 AC 1 ms
5,376 KB
testcase_28 WA -
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 1 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int R, K;
int H, W;
vector<string> G;

vector<string> rotate90(const vector<string> &g) {
  vector<string> r(g[0].size(), string(g.size(), ' '));
  for (int i = 0; i < int(g.size()); ++i) {
    for (int j = 0; j < int(g[0].size()); ++j) {
      r[j][i] = g[i][j];
    }
  }
  return r;
}

int main() {
  ios::sync_with_stdio(false);
  cin >> R >> K;
  cin >> H >> W;
  G.assign(H, string());
  for (int i = 0; i < H; ++i) {
    cin >> G[i];
  }
  for (int i = 0; i < R / 90; ++i) {
    G = rotate90(G);
  }
  vector<string> ans(int(G.size()) * K, string(G[0].size() * K, ' '));
  for (int i = 0; i < int(G.size()); ++i) {
    for (int j = 0; j < int(G[0].size()); ++j) {
      for (int k = i * K; k < i * K + K; ++k) {
        for (int l = j * K; l < j * K + K; ++l) {
          ans[k][l] = G[i][j];
        }
      }
    }
  }
  for (const string &s: ans) {
    cout << s << endl;
  }
  return 0;
}
0