結果

問題 No.21 平均の差
ユーザー fal_rndfal_rnd
提出日時 2017-04-02 20:34:06
言語 Java19
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 440 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 71,304 KB
実行使用メモリ 56,012 KB
最終ジャッジ日時 2023-09-22 07:44:33
合計ジャッジ時間 4,215 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
55,968 KB
testcase_01 AC 129 ms
55,644 KB
testcase_02 AC 129 ms
55,696 KB
testcase_03 AC 127 ms
55,464 KB
testcase_04 AC 131 ms
55,512 KB
testcase_05 AC 130 ms
55,744 KB
testcase_06 AC 127 ms
55,460 KB
testcase_07 AC 128 ms
55,656 KB
testcase_08 AC 128 ms
55,724 KB
testcase_09 AC 127 ms
56,012 KB
権限があれば一括ダウンロードができます

ソースコード

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