結果

問題 No.21 平均の差
ユーザー YukimotoPG
提出日時 2019-02-14 23:42:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 306 bytes
コンパイル時間 2,089 ms
コンパイル使用メモリ 73,972 KB
実行使用メモリ 54,236 KB
最終ジャッジ日時 2024-09-13 11:36:44
合計ジャッジ時間 4,024 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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