結果

問題 No.21 平均の差
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 23:42:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 306 bytes
コンパイル時間 1,954 ms
コンパイル使用メモリ 71,852 KB
実行使用メモリ 56,312 KB
最終ジャッジ日時 2023-10-11 12:48:55
合計ジャッジ時間 3,903 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,888 KB
testcase_01 AC 123 ms
56,184 KB
testcase_02 AC 121 ms
56,292 KB
testcase_03 AC 123 ms
56,104 KB
testcase_04 AC 122 ms
56,216 KB
testcase_05 AC 121 ms
56,312 KB
testcase_06 AC 121 ms
55,816 KB
testcase_07 AC 121 ms
56,000 KB
testcase_08 AC 122 ms
56,000 KB
testcase_09 AC 123 ms
56,264 KB
権限があれば一括ダウンロードができます

ソースコード

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