結果

問題 No.21 平均の差
ユーザー yy05853yy05853
提出日時 2018-11-22 21:07:00
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 430 bytes
コンパイル時間 1,956 ms
コンパイル使用メモリ 71,708 KB
実行使用メモリ 56,548 KB
最終ジャッジ日時 2023-08-26 04:01:40
合計ジャッジ時間 3,522 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;

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