結果

問題 No.21 平均の差
ユーザー Grenache
提出日時 2015-09-22 22:42:44
言語 Java
(openjdk 23)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 449 bytes
コンパイル時間 2,972 ms
コンパイル使用メモリ 74,352 KB
実行使用メモリ 41,688 KB
最終ジャッジ日時 2024-07-19 08:41:41
合計ジャッジ時間 4,812 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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