結果

問題 No.21 平均の差
ユーザー 37zigen
提出日時 2016-04-01 17:54:29
言語 Java
(openjdk 23)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 2,181 ms
コンパイル使用メモリ 74,096 KB
実行使用メモリ 41,600 KB
最終ジャッジ日時 2024-10-02 08:50:02
合計ジャッジ時間 4,253 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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