結果
| 問題 |
No.21 平均の差
|
| ユーザー |
|
| 提出日時 | 2022-07-30 08:14:26 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 135 ms / 5,000 ms |
| コード長 | 413 bytes |
| コンパイル時間 | 2,233 ms |
| コンパイル使用メモリ | 76,580 KB |
| 実行使用メモリ | 41,496 KB |
| 最終ジャッジ日時 | 2024-07-20 03:18:33 |
| 合計ジャッジ時間 | 4,130 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
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();
}
}