結果

問題 No.1628 Sorting Integers (MAX of M)
ユーザー みーすけみーすけ
提出日時 2021-10-01 08:17:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 3,431 ms
コンパイル使用メモリ 71,464 KB
実行使用メモリ 56,088 KB
最終ジャッジ日時 2023-09-25 17:32:12
合計ジャッジ時間 4,522 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,816 KB
testcase_01 AC 125 ms
55,772 KB
testcase_02 AC 126 ms
56,088 KB
testcase_03 AC 126 ms
55,768 KB
testcase_04 AC 126 ms
55,700 KB
testcase_05 AC 126 ms
55,608 KB
testcase_06 AC 125 ms
55,628 KB
testcase_07 AC 126 ms
56,040 KB
testcase_08 AC 126 ms
55,640 KB
testcase_09 AC 125 ms
55,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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