結果

問題 No.565 回転拡大
ユーザー fal_rndfal_rnd
提出日時 2017-09-21 19:22:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 1,038 bytes
コンパイル時間 3,971 ms
コンパイル使用メモリ 83,584 KB
実行使用メモリ 50,124 KB
最終ジャッジ日時 2024-04-26 06:37:37
合計ジャッジ時間 9,492 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
50,124 KB
testcase_01 AC 133 ms
41,280 KB
testcase_02 AC 135 ms
41,764 KB
testcase_03 AC 129 ms
41,428 KB
testcase_04 AC 131 ms
41,424 KB
testcase_05 AC 130 ms
41,000 KB
testcase_06 AC 131 ms
41,536 KB
testcase_07 AC 123 ms
40,336 KB
testcase_08 AC 135 ms
41,696 KB
testcase_09 AC 134 ms
41,432 KB
testcase_10 AC 119 ms
40,128 KB
testcase_11 AC 133 ms
41,436 KB
testcase_12 AC 135 ms
41,420 KB
testcase_13 AC 133 ms
41,540 KB
testcase_14 AC 133 ms
41,304 KB
testcase_15 AC 135 ms
41,104 KB
testcase_16 AC 123 ms
40,272 KB
testcase_17 AC 137 ms
41,532 KB
testcase_18 AC 131 ms
41,524 KB
testcase_19 AC 137 ms
41,292 KB
testcase_20 AC 129 ms
41,176 KB
testcase_21 AC 130 ms
41,528 KB
testcase_22 AC 134 ms
41,436 KB
testcase_23 AC 133 ms
41,284 KB
testcase_24 AC 135 ms
41,488 KB
testcase_25 AC 140 ms
41,848 KB
testcase_26 AC 134 ms
41,804 KB
testcase_27 AC 136 ms
41,692 KB
testcase_28 AC 120 ms
40,504 KB
testcase_29 AC 139 ms
41,528 KB
testcase_30 AC 131 ms
41,528 KB
testcase_31 AC 133 ms
41,440 KB
testcase_32 AC 131 ms
41,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Solution{
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		int r=getInt(),k=getInt(),h=getInt(),w=getInt();
		char[][]in=new char[h*k][w*k];
		{
			char[][]buf=REPS(h).mapToObj(o->s.next().toCharArray()).toArray(char[][]::new);
			for(int i=0;i<h*k;++i) {
				for(int j=0;j<w*k;++j) {
					in[i][j]=buf[i/k][j/k];
				}
			}
		}
		for(int i=0;i<r;i+=90)
			in=turn(in);
		Arrays.stream(in).map(String::valueOf).forEach(System.out::println);
	}
	static char[][] turn(final char[][]c){
		final int h=c.length,w=c[0].length;
		char[][] r=new char[w][h];
		for(int i=0;i<w;++i) {
			for(int j=0;j<h;++j) {
				r[i][j]=c[h-1-j][i];
			}
		}
		return r;
	}
}
0