結果

問題 No.21 平均の差
ユーザー キョウチクキョウチク
提出日時 2022-05-14 18:28:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 529 bytes
コンパイル時間 4,144 ms
コンパイル使用メモリ 72,184 KB
実行使用メモリ 49,444 KB
最終ジャッジ日時 2023-09-30 10:30:41
合計ジャッジ時間 4,937 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
49,388 KB
testcase_01 AC 37 ms
49,444 KB
testcase_02 AC 38 ms
49,288 KB
testcase_03 AC 37 ms
49,352 KB
testcase_04 AC 37 ms
49,204 KB
testcase_05 AC 37 ms
49,404 KB
testcase_06 AC 38 ms
49,420 KB
testcase_07 AC 38 ms
49,180 KB
testcase_08 AC 40 ms
47,808 KB
testcase_09 AC 38 ms
49,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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]);
  }
}
0