結果
問題 | No.565 回転拡大 |
ユーザー |
|
提出日時 | 2018-02-10 16:52:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,086 bytes |
コンパイル時間 | 807 ms |
コンパイル使用メモリ | 77,256 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 15:46:05 |
合計ジャッジ時間 | 1,960 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 21 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <utility> #include <string> using namespace std; vector<string> rotate90(vector<string> vs) { int h1 = vs.size(); int w1 = vs[0].size(); int h2 = w1; int w2 = h1; vector<string> rotated(h2, string(w2, '-')); for (int i = 0; i < h1; i++) { for (int j = 0; j < w1; j++) { rotated[j][i] = vs[i][j]; } } return rotated; } vector<string> rotate(vector<string> vs, int r) { auto rotated = vs; for (int i = 90; i <= r; i += 90) { rotated = rotate90(rotated); } return rotated; } vector<string> enlarge(vector<string> vs, int k) { vector<string> large; for (auto s: vs) { string t; for (auto c : s) { t += string(k, c); } for (int i = 0; i < k; i++) { large.emplace_back(t); } } return large; } int main() { int r, h, k, w; cin >> r >> k >> h >> w; vector<string> base(h); for (int i = 0; i < h; i++) { cin >> base[i]; } auto rotated = rotate(base, r); auto large = enlarge(rotated, k); for (auto s: large) { cout << s << endl; } return 0; }