結果

問題 No.1475 時計の歯車Easy
ユーザー yule10s
提出日時 2021-04-17 15:31:43
言語 Java
(openjdk 23)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 821 bytes
コンパイル時間 2,979 ms
コンパイル使用メモリ 76,680 KB
実行使用メモリ 42,616 KB
最終ジャッジ日時 2024-07-03 23:07:26
合計ジャッジ時間 9,703 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        // System.out.println("n = "+ n);
        for (int i = 0; i < n ; i++) {
            int k = sc.nextInt();
            ArrayList<Integer> parts = new ArrayList<Integer>();
            for (int j = 0; j < k; j++) {
                parts.add(sc.nextInt());
            }
            Collections.sort(parts);
            Collections.reverse(parts);
            int[] tmp = new int[parts.size()];
            parts.toArray();
            for (int value : parts) {
                System.out.print(value);
                System.out.print(" ");
            }
            System.out.print("\n");
        }
    }
}
0