結果
| 問題 | No.565 回転拡大 | 
| コンテスト | |
| ユーザー |  y_mazun | 
| 提出日時 | 2017-09-08 22:53:31 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 1,044 bytes | 
| コンパイル時間 | 532 ms | 
| コンパイル使用メモリ | 47,104 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-07 06:34:06 | 
| 合計ジャッジ時間 | 1,646 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 30 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:24:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   24 |     scanf("%s", buff);
      |     ~~~~~^~~~~~~~~~~~
main.cpp: In function ‘int getInt()’:
main.cpp:5:34: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 | inline int getInt(){ int s; scanf("%d", &s); return s; }
      |                             ~~~~~^~~~~~~~~~
            
            ソースコード
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#include <queue>
#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }
#include <set>
using namespace std;
int main(){
  const int r = getInt() / 90;
  const int k = getInt();
  const int h = getInt();
  const int w = getInt();
  const int n = max(h, w);
  vector<vector<char> > g(n, vector<char>(n, ' '));
  const int ww = r % 2 == 0 ? w : h;
  const int hh = r % 2 == 0 ? h : w;
  REP(i,h){
    char buff[256];
    scanf("%s", buff);
    REP(j,w) g[i][j] = buff[j];
  }
  REP(_,r){
    vector<vector<char> > next(n, vector<char>(n));
    REP(i,n) REP(j,n){
      next[j][n - 1 - i] = g[i][j];
    }
    g.swap(next);
    // REP(i,n) { REP(j,n) { printf("%c", g[i][j]); } puts(""); };
    // puts("---");
  }
  int oX = n;
  int oY = n;
  REP(i,n) REP(j,n) if(g[i][j] != ' ') {
    oX = min(oX, j);
    oY = min(oY, i);
  }
  // printf("%d %d\n", oX, oY);
  REP(i,hh) REP(_, k) { REP(j,ww) REP(_, k) { printf("%c", g[oY + i][oX + j]); } puts(""); };
  return 0;
}
            
            
            
        