結果

問題 No.21 平均の差
ユーザー atkrym
提出日時 2016-11-07 17:47:15
言語 Java
(openjdk 23)
結果
AC  
実行時間 118 ms / 5,000 ms
コード長 411 bytes
コンパイル時間 1,792 ms
コンパイル使用メモリ 74,120 KB
実行使用メモリ 54,444 KB
最終ジャッジ日時 2024-11-25 03:54:05
合計ジャッジ時間 3,520 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] ary = new int[n];
        for (int i = 0;i < n;i++) {
            ary[i] = sc.nextInt();
        }
        Arrays.sort(ary);
        System.out.println(ary[n-1]-ary[0]);
    }
}
0