結果

問題 No.21 平均の差
ユーザー pao2pao2pao2pao2
提出日時 2022-07-30 08:14:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 413 bytes
コンパイル時間 2,581 ms
コンパイル使用メモリ 75,116 KB
実行使用メモリ 56,396 KB
最終ジャッジ日時 2023-09-27 09:10:49
合計ジャッジ時間 4,286 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,844 KB
testcase_01 AC 127 ms
55,976 KB
testcase_02 AC 125 ms
55,960 KB
testcase_03 AC 126 ms
55,716 KB
testcase_04 AC 125 ms
55,860 KB
testcase_05 AC 126 ms
55,976 KB
testcase_06 AC 125 ms
56,396 KB
testcase_07 AC 125 ms
55,808 KB
testcase_08 AC 126 ms
56,160 KB
testcase_09 AC 128 ms
56,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

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

		int N = sc.nextInt();
		int K = sc.nextInt();
		int[] n = new int[N];
		Arrays.setAll(n, i -> sc.nextInt());
		int min = Arrays.stream(n).min().getAsInt();
		int max = Arrays.stream(n).max().getAsInt();

		System.out.println(max - min);

		sc.close();
	}
}
0