結果

問題 No.21 平均の差
ユーザー 37zigen37zigen
提出日時 2016-04-01 17:54:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 1,953 ms
コンパイル使用メモリ 74,092 KB
実行使用メモリ 54,380 KB
最終ジャッジ日時 2024-04-10 07:07:44
合計ジャッジ時間 4,015 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
54,380 KB
testcase_01 AC 126 ms
54,316 KB
testcase_02 AC 125 ms
54,112 KB
testcase_03 AC 124 ms
54,260 KB
testcase_04 AC 126 ms
54,184 KB
testcase_05 AC 125 ms
54,352 KB
testcase_06 AC 128 ms
54,216 KB
testcase_07 AC 126 ms
54,284 KB
testcase_08 AC 125 ms
54,228 KB
testcase_09 AC 126 ms
54,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

	}
}
0