結果
| 問題 | No.21 平均の差 |
| コンテスト | |
| ユーザー |
fkwnw3_1243
|
| 提出日時 | 2017-04-23 13:29:17 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 31 ms / 5,000 ms |
| + 741µs | |
| コード長 | 704 bytes |
| 記録 | |
| コンパイル時間 | 1,621 ms |
| コンパイル使用メモリ | 82,896 KB |
| 実行使用メモリ | 40,368 KB |
| 最終ジャッジ日時 | 2026-08-22 09:48:12 |
| 合計ジャッジ時間 | 3,780 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader =new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(reader.readLine());
int K = Integer.parseInt(reader.readLine());
int max = Integer.MIN_VALUE;
int min = Integer.MAX_VALUE;
for (int i = 0; i < N; i++) {
int n = Integer.parseInt(reader.readLine());
max = Math.max(max,n);
min = Math.min(min,n);
}
int difference = (max - min);
System.out.println(difference);
}
}
fkwnw3_1243