結果
問題 | No.21 平均の差 |
ユーザー |
![]() |
提出日時 | 2022-05-14 18:28:22 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 57 ms / 5,000 ms |
コード長 | 529 bytes |
コンパイル時間 | 3,328 ms |
コンパイル使用メモリ | 74,488 KB |
実行使用メモリ | 50,612 KB |
最終ジャッジ日時 | 2024-07-23 04:37:36 |
合計ジャッジ時間 | 4,527 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
import java.io.*; import java.util.Arrays; public class Test7 { public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; line=br.readLine(); int n=Integer.parseInt(line); line=br.readLine(); int k=Integer.parseInt(line); int[] data=new int[n]; for(int i=0;i<n;i++){ line=br.readLine(); data[i]=Integer.parseInt(line); } Arrays.sort(data); System.out.println(data[n-1]-data[0]); } }