結果

問題 No.21 平均の差
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-07 16:24:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 402 bytes
コンパイル時間 2,005 ms
コンパイル使用メモリ 71,948 KB
実行使用メモリ 56,156 KB
最終ジャッジ日時 2023-09-17 15:46:33
合計ジャッジ時間 4,012 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,804 KB
testcase_01 AC 127 ms
56,108 KB
testcase_02 AC 127 ms
55,536 KB
testcase_03 AC 126 ms
56,156 KB
testcase_04 AC 127 ms
56,008 KB
testcase_05 AC 127 ms
55,932 KB
testcase_06 AC 126 ms
55,636 KB
testcase_07 AC 127 ms
55,984 KB
testcase_08 AC 128 ms
56,096 KB
testcase_09 AC 129 ms
55,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int n = koko.nextInt();
        int k = koko.nextInt();
        int[] p = new int[n];
        for(int i=0; i<n; i++){
            p[i] = koko.nextInt();
        }
        Arrays.sort(p);
        System.out.println(p[n-1]-p[0]);
        
    }
}
0