結果

問題 No.1475 時計の歯車Easy
ユーザー tentententen
提出日時 2021-04-14 08:27:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 1,310 bytes
コンパイル時間 2,077 ms
コンパイル使用メモリ 74,560 KB
実行使用メモリ 33,904 KB
最終ジャッジ日時 2023-09-12 21:53:02
合計ジャッジ時間 5,988 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
33,504 KB
testcase_01 AC 44 ms
33,904 KB
testcase_02 AC 44 ms
33,564 KB
testcase_03 AC 41 ms
33,876 KB
testcase_04 AC 40 ms
33,508 KB
testcase_05 AC 40 ms
33,420 KB
testcase_06 AC 40 ms
33,848 KB
testcase_07 AC 39 ms
33,756 KB
testcase_08 AC 40 ms
33,600 KB
testcase_09 AC 41 ms
33,508 KB
testcase_10 AC 41 ms
33,460 KB
testcase_11 AC 40 ms
33,472 KB
testcase_12 AC 41 ms
33,700 KB
testcase_13 AC 38 ms
33,452 KB
testcase_14 AC 39 ms
33,748 KB
testcase_15 AC 41 ms
33,868 KB
testcase_16 AC 40 ms
33,388 KB
testcase_17 AC 40 ms
33,444 KB
testcase_18 AC 39 ms
33,840 KB
testcase_19 AC 40 ms
33,476 KB
testcase_20 AC 40 ms
33,464 KB
testcase_21 AC 41 ms
33,444 KB
testcase_22 AC 39 ms
33,412 KB
testcase_23 AC 39 ms
33,604 KB
testcase_24 AC 38 ms
33,824 KB
testcase_25 AC 39 ms
33,468 KB
testcase_26 AC 39 ms
33,408 KB
testcase_27 AC 40 ms
33,832 KB
testcase_28 AC 41 ms
33,680 KB
testcase_29 AC 39 ms
33,604 KB
testcase_30 AC 40 ms
33,600 KB
testcase_31 AC 40 ms
33,656 KB
testcase_32 AC 41 ms
33,860 KB
testcase_33 AC 41 ms
33,704 KB
testcase_34 AC 41 ms
33,456 KB
testcase_35 AC 39 ms
33,760 KB
testcase_36 AC 41 ms
33,772 KB
testcase_37 AC 40 ms
33,492 KB
testcase_38 AC 38 ms
33,352 KB
testcase_39 AC 39 ms
33,360 KB
testcase_40 AC 40 ms
33,768 KB
testcase_41 AC 40 ms
33,448 KB
testcase_42 AC 40 ms
33,388 KB
testcase_43 AC 40 ms
33,840 KB
testcase_44 AC 41 ms
33,620 KB
testcase_45 AC 41 ms
33,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            int k = sc.nextInt();
            int[] parts = new int[k];
            for (int j = 0; j < k; j++) {
                parts[j] = -sc.nextInt();
            }
            Arrays.sort(parts);
            for (int j = 0; j < k; j++) {
                if (j > 0) {
                    sb.append(" ");
                }
                sb.append(-parts[j]);
            }
            sb.append("\n");
        }
        System.out.print(sb);
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public String next() throws Exception {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0