結果

問題 No.21 平均の差
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-02-03 19:27:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 2,345 ms
コンパイル使用メモリ 74,244 KB
実行使用メモリ 57,580 KB
最終ジャッジ日時 2023-10-21 18:54:06
合計ジャッジ時間 4,473 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
57,568 KB
testcase_01 AC 139 ms
57,500 KB
testcase_02 AC 140 ms
57,136 KB
testcase_03 AC 140 ms
57,440 KB
testcase_04 AC 141 ms
57,448 KB
testcase_05 AC 143 ms
55,368 KB
testcase_06 AC 142 ms
57,096 KB
testcase_07 AC 142 ms
57,412 KB
testcase_08 AC 140 ms
57,412 KB
testcase_09 AC 143 ms
57,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Test {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);

		int N = in.nextInt();
		int K = in.nextInt();
		int [] nn = new int[N];

		for(int i=0; i<N; i++) {
			nn[i] = in.nextInt();
		}

		Arrays.sort(nn);

		System.out.println(nn[N - 1] - nn[0]);
	}
}
0