結果

問題 No.21 平均の差
ユーザー TatsuDXTatsuDX
提出日時 2016-09-08 23:28:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 336 bytes
コンパイル時間 3,180 ms
コンパイル使用メモリ 74,132 KB
実行使用メモリ 54,204 KB
最終ジャッジ日時 2024-04-27 18:05:26
合計ジャッジ時間 4,470 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
53,984 KB
testcase_01 AC 111 ms
53,156 KB
testcase_02 AC 113 ms
53,680 KB
testcase_03 AC 118 ms
53,988 KB
testcase_04 AC 118 ms
54,204 KB
testcase_05 AC 117 ms
53,680 KB
testcase_06 AC 102 ms
52,756 KB
testcase_07 AC 102 ms
52,920 KB
testcase_08 AC 108 ms
53,828 KB
testcase_09 AC 114 ms
54,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt(), t = sc.nextInt(), max = 0, min = 1000;
		for(int i = 0; i < n; i++){
			t = sc.nextInt();
			max = Math.max(max, t);
			min = Math.min(min, t);
		}
		System.out.println(max-min);
	}
}
0