結果

問題 No.646 逆ピラミッド
ユーザー tentententen
提出日時 2020-11-12 09:20:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 2,049 ms
コンパイル使用メモリ 72,524 KB
実行使用メモリ 56,276 KB
最終ジャッジ日時 2023-09-30 01:07:20
合計ジャッジ時間 4,280 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
54,184 KB
testcase_01 AC 122 ms
55,744 KB
testcase_02 AC 118 ms
55,692 KB
testcase_03 AC 121 ms
55,920 KB
testcase_04 AC 120 ms
53,364 KB
testcase_05 AC 120 ms
55,752 KB
testcase_06 AC 122 ms
56,068 KB
testcase_07 AC 118 ms
56,276 KB
testcase_08 AC 117 ms
55,896 KB
testcase_09 AC 117 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        StringBuilder sb = new StringBuilder();
        for (int i = n; i >= 1; i--) {
            for (int j = 0; j < i; j++) {
                sb.append(n);
            }
            sb.append("\n");
        }
        System.out.print(sb);
    }
}
0