結果

問題 No.21 平均の差
ユーザー k_kadorak_kadora
提出日時 2015-05-18 02:48:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 332 bytes
コンパイル時間 3,186 ms
コンパイル使用メモリ 72,144 KB
実行使用メモリ 58,300 KB
最終ジャッジ日時 2023-09-20 09:42:35
合計ジャッジ時間 5,122 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
58,300 KB
testcase_01 AC 119 ms
55,800 KB
testcase_02 AC 121 ms
55,776 KB
testcase_03 AC 120 ms
56,016 KB
testcase_04 AC 120 ms
55,928 KB
testcase_05 AC 119 ms
55,720 KB
testcase_06 AC 121 ms
56,032 KB
testcase_07 AC 119 ms
55,500 KB
testcase_08 AC 124 ms
55,548 KB
testcase_09 AC 124 ms
55,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Average{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.nextInt();
		int min,max,c;
		min = 1000;
		max = 1;
		for (int i = 0;i < n;i++){
			c = sc.nextInt();
			if(min>c)min = c;
			if(max<c)max=c;
		}
		System.out.println(max-min);
	}
}
0