結果

問題 No.21 平均の差
ユーザー fal_rnd
提出日時 2017-04-02 20:34:06
言語 Java
(openjdk 23)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 440 bytes
コンパイル時間 1,698 ms
コンパイル使用メモリ 74,148 KB
実行使用メモリ 54,560 KB
最終ジャッジ日時 2024-07-08 00:14:04
合計ジャッジ時間 3,353 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class Main{

	static final Scanner	s	=new Scanner(System.in);

	public static void main(String args[]){
		input();
		solve();
	}


	static int n,k,a[];
	private static void input(){
		n=s.nextInt();
		k=s.nextInt();
		a=new int[n];
		for(int i=0;i<n;i++) {
			a[i]=s.nextInt();
		}
		Arrays.sort(a);
	}

	private static void solve(){
		System.out.println(a[a.length-1]-a[0]);
	}
}
0