結果

問題 No.21 平均の差
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-11 04:25:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 5,000 ms
コード長 391 bytes
コンパイル時間 5,154 ms
コンパイル使用メモリ 71,444 KB
実行使用メモリ 55,980 KB
最終ジャッジ日時 2023-08-16 18:14:09
合計ジャッジ時間 4,315 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,980 KB
testcase_01 AC 126 ms
55,980 KB
testcase_02 AC 126 ms
55,940 KB
testcase_03 AC 126 ms
55,740 KB
testcase_04 AC 128 ms
55,656 KB
testcase_05 AC 127 ms
55,416 KB
testcase_06 AC 127 ms
55,580 KB
testcase_07 AC 127 ms
55,580 KB
testcase_08 AC 126 ms
55,896 KB
testcase_09 AC 126 ms
55,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int [] n = new int [N];
        for(int i=0; i<N; i++){
            n[i] = sc.nextInt();
        }
        Arrays.sort(n);
        int r = n[N-1] - n[0];
        System.out.println(r);
    }
}
0