結果

問題 No.21 平均の差
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-29 01:38:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 508 bytes
コンパイル時間 3,386 ms
コンパイル使用メモリ 74,620 KB
実行使用メモリ 37,188 KB
最終ジャッジ日時 2024-05-01 21:40:12
合計ジャッジ時間 4,543 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
37,044 KB
testcase_01 AC 53 ms
36,936 KB
testcase_02 AC 54 ms
37,092 KB
testcase_03 AC 55 ms
36,736 KB
testcase_04 AC 55 ms
36,824 KB
testcase_05 AC 54 ms
37,188 KB
testcase_06 AC 55 ms
37,076 KB
testcase_07 AC 55 ms
36,776 KB
testcase_08 AC 54 ms
37,024 KB
testcase_09 AC 54 ms
36,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class No21{
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String k = br.readLine();
		int[] num = new int[n];
		for(int i=0; i < n; i++)
			num[i] = Integer.parseInt(br.readLine());
		Arrays.sort(num);
		System.out.println(num[n-1] - num[0]);
	}
}
0