結果

問題 No.21 平均の差
ユーザー shinshin
提出日時 2022-05-12 19:06:12
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 449 bytes
コンパイル時間 4,191 ms
コンパイル使用メモリ 74,052 KB
実行使用メモリ 56,864 KB
最終ジャッジ日時 2023-09-27 18:44:38
合計ジャッジ時間 6,276 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
55,900 KB
testcase_01 AC 112 ms
55,580 KB
testcase_02 AC 109 ms
56,864 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 110 ms
56,412 KB
testcase_06 AC 112 ms
55,940 KB
testcase_07 AC 114 ms
56,200 KB
testcase_08 AC 113 ms
55,836 KB
testcase_09 AC 108 ms
55,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.TreeSet;
public class No21 {

	public static void main(String[] args) {
		//平均の差
		
		TreeSet<Integer> n = new TreeSet<>();
		
		Scanner s = new Scanner(System.in);
		int N = Integer.parseInt(s.nextLine()) , K = Integer.parseInt(s.nextLine()) , i = 0;
		for(i = 0;i < N;i++) {
			n.add(Integer.parseInt(s.nextLine()));
		}
		s.close();
		
		System.out.println(n.pollLast() - n.pollFirst());

	}

}
0