結果

問題 No.21 平均の差
ユーザー mustonmuston
提出日時 2016-05-10 11:21:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 145 ms / 5,000 ms
コード長 349 bytes
コンパイル時間 2,240 ms
コンパイル使用メモリ 74,800 KB
実行使用メモリ 41,544 KB
最終ジャッジ日時 2024-04-15 15:03:57
合計ジャッジ時間 4,598 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
41,368 KB
testcase_01 AC 141 ms
41,484 KB
testcase_02 AC 142 ms
41,428 KB
testcase_03 AC 143 ms
41,276 KB
testcase_04 AC 145 ms
41,544 KB
testcase_05 AC 139 ms
41,512 KB
testcase_06 AC 140 ms
41,224 KB
testcase_07 AC 143 ms
41,488 KB
testcase_08 AC 141 ms
41,304 KB
testcase_09 AC 141 ms
41,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
class Aaf {
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    int K = scan.nextInt();
    int [] n = new int [N];
    for(int i=0; i<N; i++) n[i] = scan.nextInt();
    Arrays.sort(n);
    int c = n[N-1] - n[0];
    System.out.println(c);
  }
}
0