結果

問題 No.21 平均の差
ユーザー TatsuDXTatsuDX
提出日時 2016-09-08 23:28:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 336 bytes
コンパイル時間 6,106 ms
コンパイル使用メモリ 71,768 KB
実行使用メモリ 56,136 KB
最終ジャッジ日時 2023-08-09 23:59:35
合計ジャッジ時間 5,408 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,600 KB
testcase_01 AC 125 ms
55,920 KB
testcase_02 AC 125 ms
55,692 KB
testcase_03 AC 124 ms
55,700 KB
testcase_04 AC 125 ms
55,940 KB
testcase_05 AC 124 ms
56,136 KB
testcase_06 AC 122 ms
55,884 KB
testcase_07 AC 123 ms
55,664 KB
testcase_08 AC 123 ms
55,668 KB
testcase_09 AC 124 ms
56,064 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