結果

問題 No.565 回転拡大
ユーザー ふうふう
提出日時 2017-09-08 23:35:22
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,380 bytes
コンパイル時間 925 ms
コンパイル使用メモリ 82,556 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 21:57:33
合計ジャッジ時間 4,136 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 RE -
testcase_05 AC 2 ms
5,376 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
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 RE -
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 RE -
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 RE -
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 RE -
testcase_23 AC 2 ms
5,376 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 1 ms
5,376 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:28:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   28 |                 scanf("%s", c[i]);
      |                 ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
#include <map>


using namespace std;

#define MOD 1000000007
#define INF 2147483647
#define ll long long

int main()
{
	int r, k, h, w;
	int tmp;
	cin >> r >> k >> h >> w;
	char c[105][105];

	for (int i = 0; i < h; i++) {
		scanf("%s", c[i]);
	}

	/* 回転 */
	char c1[105][105];
	if (r == 90 || r == 270) {
		for (int i = 0; i < w; i++) {
			for (int j = 0; j < h; j++) {
				c1[i][j] = c[h-j-1][i];
			}
		}
		tmp = h;
		h = w;
		w = tmp;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				c[i][j] = c1[i][j];
			}
		}
	}


	if (r == 180 || r == 270) {
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				c1[i][j] = c[h - i - 1][w - j - 1];
			}
		}
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				c[i][j] = c1[i][j];
			}
		}
	}
	for (int i = 0; i < h * k; i++) {
		for (int j = 0; j < w * k; j++) {
			c1[i][j] = c[i / k][j / k];
		}
	}
	h = h * k;
	w = w * k;
	for (int i = 0; i < h * k; i++) {
		for (int j = 0; j < w * k; j++) {
			c[i][j] = c1[i][j];
		}
	}
	


	/* 表示 */
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			printf("%c", c[i][j]);
		}
		printf("\n");
	}

	return (0);
}
0