結果

問題 No.565 回転拡大
ユーザー koprickykopricky
提出日時 2017-10-07 18:57:51
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,929 bytes
コンパイル時間 1,334 ms
コンパイル使用メモリ 161,564 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-28 12:52:33
合計ジャッジ時間 2,331 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 11;

string s[MAX_N];
char t[MAX_N][MAX_N];
char ss[MAX_N*MAX_N][MAX_N*MAX_N];

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int r,K,h,w;
    cin >> r >> K >> h >> w;
    rep(i,h){
        cin >> t[i];
    }
    int nh,nw;
    if(r == 0){
        nh = h,nw = w;
        rep(i,nh){
            rep(j,nw){
                s[i][j] = t[i][j];
            }
        }
    }else if(r == 90){
        nh = w,nw = h;
        rep(i,nh){
            rep(j,nw){
                s[i][j] = t[nw-1-j][i];
            }
        }
    }else if(r == 180){
        nh = h,nw = w;
        rep(i,nh){
            rep(j,nw){
                s[i][j] = t[nh-1-i][nw-1-j];
            }
        }
    }else{
        nh = w,nw = h;
        rep(i,nh){
            rep(j,nw){
                s[i][j] = t[j][nh-1-i];
            }
        }
    }
    rep(i,nh){
        rep(j,nw){
            int sh=K*i,sw=K*j;
            rep(k,K){
                rep(l,K){
                    ss[sh+k][sw+l] = s[i][j];
                }
            }
        }
    }
    rep(i,K*nh){
        rep(j,K*nw){
            cout << ss[i][j];
        }
        cout << endl;
    }
    return 0;
}
0