結果

問題 No.21 平均の差
ユーザー soujikisoujiki
提出日時 2015-04-24 19:39:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 333 bytes
コンパイル時間 3,573 ms
コンパイル使用メモリ 72,440 KB
実行使用メモリ 56,396 KB
最終ジャッジ日時 2023-09-18 09:19:33
合計ジャッジ時間 5,700 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
55,820 KB
testcase_01 AC 131 ms
55,804 KB
testcase_02 AC 129 ms
55,812 KB
testcase_03 AC 129 ms
55,976 KB
testcase_04 AC 130 ms
53,832 KB
testcase_05 AC 130 ms
56,004 KB
testcase_06 AC 129 ms
55,820 KB
testcase_07 AC 128 ms
55,768 KB
testcase_08 AC 128 ms
56,076 KB
testcase_09 AC 130 ms
56,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Yukicoder_21{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int K = stdIn.nextInt();
		int[] num = new int[N];
		for(int i=0;i<N;i++){
			num[i] = stdIn.nextInt();
		}
		Arrays.sort(num);
		System.out.println(num[N-1] - num[0]);
	}
}
0