結果

問題 No.21 平均の差
ユーザー GrenacheGrenache
提出日時 2015-09-22 22:42:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 449 bytes
コンパイル時間 5,866 ms
コンパイル使用メモリ 72,960 KB
実行使用メモリ 56,564 KB
最終ジャッジ日時 2023-09-26 14:29:15
合計ジャッジ時間 7,540 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,748 KB
testcase_01 AC 121 ms
55,836 KB
testcase_02 AC 122 ms
56,152 KB
testcase_03 AC 122 ms
56,504 KB
testcase_04 AC 121 ms
56,312 KB
testcase_05 AC 121 ms
56,564 KB
testcase_06 AC 122 ms
55,540 KB
testcase_07 AC 123 ms
56,348 KB
testcase_08 AC 121 ms
55,860 KB
testcase_09 AC 121 ms
55,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;


public class Main_yukicoder21 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] nn = new int[n];
        for (int i = 0; i < n; i++) {
        	nn[i] = sc.nextInt();
        }
        Arrays.sort(nn);

        System.out.println(nn[n - 1] - nn[0]);

        sc.close();
    }
}
0