結果

問題 No.565 回転拡大
ユーザー homesentinelhomesentinel
提出日時 2017-09-09 02:09:10
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,768 bytes
コンパイル時間 1,098 ms
コンパイル使用メモリ 110,260 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 03:04:46
合計ジャッジ時間 2,062 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#define REP(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 1
#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR
#endif


//改造
typedef long long int ll;
using namespace std;


//ここから編集する
int K, H, W;

void rotate(vector<vector<char>> &vv) {
    vector<vector<char> > tmp((unsigned long) max(H, W), vector<char>((unsigned long) max(H, W), 'b'));
    REP(i, 0, vv.size()) {
        REP(j, 0, vv.size()) {
            tmp[j][vv.size() - 1 - i] = vv[i][j];
        }
    }
    vv = tmp;
}

int main() {
    int R;
    cin >> R >> K >> H >> W;
    vector<vector<char> > vv((unsigned long) max(H, W), vector<char>((unsigned long) max(H, W), 'a'));
    REP(i, 0, vv.size()) {
        REP(j, 0, vv.size()) {
            vv[i][j] = 'a';
        }
    }
    REP(i, 0, H) {
        REP(j, 0, W) {
            char tmp;
            cin >> tmp;
            vv[i][j] = tmp;
        }
    }

    REP(i, 0, R / 90) {
//        cout << "---debug---" << endl;
//        REP(i, 0, vv.size()) {
//            REP(m, 0, vv.size()) {
//                cout << vv[i][m];
//            }
//            cout << endl;
//        }
//        cout << "---" << endl;

        rotate(vv);
    }

//    cout << "---debug---" << endl;
//    REP(i, 0, vv.size()) {
//        REP(m, 0, vv.size()) {
//            cout << vv[i][m];
//        }
//        cout << endl;
//    }
//    cout << "---" << endl;



    REP(i, 0, vv.size()) {
        REP(j, 0, K) {
            bool wflag = false;
            REP(m, 0, vv.size()) {
                REP(n, 0, K) {
                    if (vv[i][m] != 'a') {
                        wflag = true;
                        cout << vv[i][m];
                    }
                }
            }
            if (wflag) cout << endl;
        }
    }


    return 0;
}
0