結果
問題 | No.21 平均の差 |
ユーザー |
|
提出日時 | 2020-05-20 09:44:48 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 131 ms / 5,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 3,592 ms |
コンパイル使用メモリ | 73,652 KB |
実行使用メモリ | 54,244 KB |
最終ジャッジ日時 | 2024-10-01 23:26:57 |
合計ジャッジ時間 | 4,174 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
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]; int min = 100000; int max = 0; for(int i=0; i<N; i++){ n[i] = sc.nextInt(); max = Math.max(max, n[i]); min = Math.min(min, n[i]); } sc.close(); System.out.println(max-min); } }