結果
| 問題 |
No.21 平均の差
|
| ユーザー |
kou6839
|
| 提出日時 | 2014-11-16 15:46:56 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 138 ms / 5,000 ms |
| コード長 | 378 bytes |
| コンパイル時間 | 2,209 ms |
| コンパイル使用メモリ | 74,292 KB |
| 実行使用メモリ | 54,144 KB |
| 最終ジャッジ日時 | 2024-12-31 20:37:48 |
| 合計ジャッジ時間 | 4,368 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int max=0;
int min=Integer.MAX_VALUE;
for(int i=0;i<n;i++){
int temp=sc.nextInt();
max=Math.max(max, temp);
min=Math.min(min, temp);
}
System.out.println(max-min);
}
}
kou6839