結果

問題 No.21 平均の差
ユーザー ちよちゃんちよちゃん
提出日時 2016-05-24 16:55:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 441 bytes
コンパイル時間 3,350 ms
コンパイル使用メモリ 74,676 KB
実行使用メモリ 41,332 KB
最終ジャッジ日時 2024-04-16 12:19:51
合計ジャッジ時間 5,228 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
40,200 KB
testcase_01 AC 134 ms
41,140 KB
testcase_02 AC 133 ms
41,236 KB
testcase_03 AC 135 ms
41,252 KB
testcase_04 AC 135 ms
41,012 KB
testcase_05 AC 132 ms
41,136 KB
testcase_06 AC 133 ms
41,332 KB
testcase_07 AC 134 ms
41,064 KB
testcase_08 AC 134 ms
41,256 KB
testcase_09 AC 134 ms
41,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

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

public class Yuki21 {
	
	public static void main(String[] args) {		
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int group = scan.nextInt();
		int[] numArr = new int[count];
		for (int i = 0; i < count; i++ ) {
			numArr[i] = scan.nextInt();
		}
		scan.close();
		Arrays.sort(numArr);
		System.out.println(numArr[count-1] - numArr[0]);
	}
}
0