結果
| 問題 |
No.565 回転拡大
|
| コンテスト | |
| ユーザー |
aaa
|
| 提出日時 | 2018-09-17 22:27:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 2,586 bytes |
| コンパイル時間 | 897 ms |
| コンパイル使用メモリ | 101,080 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 07:51:19 |
| 合計ジャッジ時間 | 1,747 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
using namespace std;
int main() {
int i, j;
int r, k, h, w;
//vector<vector<int>>c(10, vector<int>(10, -1));
vector<string>c,c2;
cin >> r >> k;
cin >> h >> w;
for (i = 0; i < h; i++) {
string st;
cin >> st;
c.push_back(st);
}
int h2 = h, w2 = w;
if (r == 90) {
h2 = w;
w2 = h;
string st;
for (i = 0; i < w2; i++) {
st += 'a';
}
for (i = 0; i < h2; i++) {
c2.push_back(st);
}
for (i = 0; i < h2; i++) {
for (j = 0; j < w2; j++) {
c2[i][j] = c[h - j - 1][i];
}
}
}
if (r == 180) {
//h2 = w;
//w2 = h;
string st;
for (i = 0; i < w2; i++) {
st += 'a';
}
for (i = 0; i < h2; i++) {
c2.push_back(st);
}
for (i = 0; i < h2; i++) {
for (j = 0; j < w2; j++) {
c2[i][j] = c[h2 - i -1][w2 - j - 1];
}
}
}
if (r == 270) {
vector<string>c3;
string st2;
for (i = 0; i < w2; i++) {
st2 += 'a';
}
for (i = 0; i < h2; i++) {
c3.push_back(st2);
}
for (i = 0; i < h2; i++) {
for (j = 0; j < w2; j++) {
c3[i][j] = c[h2 - i - 1][w2 - j - 1];
}
}
h2 = w;
w2 = h;
string st;
for (i = 0; i < w2; i++) {
st += 'a';
}
for (i = 0; i < h2; i++) {
c2.push_back(st);
}
for (i = 0; i < h2; i++) {
for (j = 0; j < w2; j++) {
c2[i][j] = c3[h - j - 1][i];
}
}
/*
h2 = w;
w2 = h;
string st;
for (i = 0; i < w2; i++) {
st += 'a';
}
for (i = 0; i < h2; i++) {
c2.push_back(st);
}
for (i = 0; i < h2; i++) {
for (j = 0; j < w2; j++) {
c2[i][j] = c[j][i];
}
}*/
}
if (r == 0) {
h2 = h;
w2 = w;
string st;
for (i = 0; i < w2; i++) {
st += 'a';
}
for (i = 0; i < h2; i++) {
c2.push_back(st);
}
for (i = 0; i < h2; i++) {
for (j = 0; j < w2; j++) {
c2[i][j] = c[i][j];
}
}
}
//cout << endl;
for (i = 0; i < h2 * k; i++) {
for (j = 0; j < w2 * k; j++) {
if (i == 0 && j == 0) {
//cout << c2[1 / k][1 / k];
cout << c2[0][0];
}
else if (i == 0) {
//cout << c2[1 / k][j / k];
cout << c2[0][j / k];
}
else if (j == 0) {
//cout << c2[i / k][1 / k];
cout << c2[i / k][0];
}
else {
cout << c2[i / k][j / k];
}
}
cout << endl;
}
//cout << endl;
getchar();
getchar();
return 0;
}
aaa