結果

問題 No.565 回転拡大
ユーザー okayunonaha
提出日時 2017-09-08 23:10:30
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,648 bytes
コンパイル時間 1,559 ms
コンパイル使用メモリ 159,928 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 06:43:54
合計ジャッジ時間 2,326 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int r, k, h, w;
string s[11];

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

    if (r == 0) {
        for (int i = 0; i < h; ++i) {
            for (int u = 0; u < k; ++u) {
                for (int j = 0; j < w; ++j) {
                    for (int t = 0; t < k; ++t) {
                        cout << s[i][j];
                    }
                }
                cout << endl;
            }
        }
    }
    else if (r == 90) {
        for (int i = 0; i < w; i++) {
            for (int u = 0; u < k; ++u) {
                for (int j = h - 1; j >= 0; j--) {
                    //cout << i << " " << j << endl;
                    for (int t = 0; t < k; ++t) {
                        cout << s[j][i];
                    }
                }
                cout << endl;
            }
        }
    }
    else if (r == 180) {
        for (int i = h - 1; i >= 0; i--) {
            for (int u = 0; u < k; ++u) {        
                for (int j = w - 1; j >= 0; j--) {
                    for (int t = 0; t < k; ++t) {
                        cout << s[i][j];
                    }
                }
                cout << endl;
            }
        }
    }
    else if (r == 270) {
        for (int i = w - 1; i >= 0; i--) {
            for (int u = 0; u < k; ++u) {
                for (int j = 0; j < h; ++j) {
                    for (int u = 0; u < k; ++u) {
                        cout << s[j][i];
                    }
                }
                cout << endl;
            }
        }
    }

    return 0;
}
0