結果

問題 No.2728 Grid Expansion
ユーザー tentententen
提出日時 2024-04-22 09:44:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 1,537 bytes
コンパイル時間 2,391 ms
コンパイル使用メモリ 78,344 KB
実行使用メモリ 37,152 KB
最終ジャッジ日時 2024-04-22 09:44:55
合計ジャッジ時間 4,216 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
36,980 KB
testcase_01 AC 52 ms
36,972 KB
testcase_02 AC 52 ms
36,760 KB
testcase_03 AC 53 ms
36,904 KB
testcase_04 AC 54 ms
36,912 KB
testcase_05 AC 53 ms
36,964 KB
testcase_06 AC 52 ms
37,108 KB
testcase_07 AC 53 ms
36,636 KB
testcase_08 AC 52 ms
36,980 KB
testcase_09 AC 53 ms
37,052 KB
testcase_10 AC 54 ms
37,152 KB
testcase_11 AC 53 ms
36,640 KB
testcase_12 AC 56 ms
36,780 KB
testcase_13 AC 52 ms
37,064 KB
testcase_14 AC 52 ms
36,968 KB
testcase_15 AC 52 ms
36,880 KB
testcase_16 AC 52 ms
36,904 KB
testcase_17 AC 54 ms
37,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int k = sc.nextInt();
        char[][] field = new char[n][];
        for (int i = 0; i < n; i++) {
            field[i] = sc.next().toCharArray();
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n * k; i++) {
            for (int j = 0; j < n * k; j++) {
                sb.append(field[i / k][j / k]);
            }
            sb.append("\n");
        }
        System.out.print(sb);
    }
}
class Scanner {
    BufferedReader br;
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
        } catch (Exception e) {
            
        }
    }
    
    public int nextInt() {
        return Integer.parseInt(next());
    }
    
    public long nextLong() {
        return Long.parseLong(next());
    }
    
    public double nextDouble() {
        return Double.parseDouble(next());
    }
    
    public String next() {
        try {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            return st.nextToken();
        }
    }
    
}
0