結果

問題 No.476 正しくない平均
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-10 15:26:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 2,652 ms
コンパイル使用メモリ 74,628 KB
実行使用メモリ 41,804 KB
最終ジャッジ日時 2024-04-21 14:45:40
合計ジャッジ時間 7,793 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
41,588 KB
testcase_01 AC 138 ms
40,916 KB
testcase_02 AC 144 ms
41,496 KB
testcase_03 AC 144 ms
41,488 KB
testcase_04 AC 139 ms
41,540 KB
testcase_05 AC 142 ms
41,532 KB
testcase_06 AC 137 ms
41,076 KB
testcase_07 AC 139 ms
41,756 KB
testcase_08 AC 137 ms
40,900 KB
testcase_09 AC 140 ms
41,692 KB
testcase_10 AC 148 ms
41,548 KB
testcase_11 AC 152 ms
41,316 KB
testcase_12 AC 153 ms
41,412 KB
testcase_13 AC 144 ms
41,744 KB
testcase_14 AC 142 ms
41,804 KB
testcase_15 AC 142 ms
41,536 KB
testcase_16 AC 142 ms
41,684 KB
testcase_17 AC 146 ms
41,512 KB
testcase_18 AC 132 ms
41,372 KB
testcase_19 AC 140 ms
41,620 KB
testcase_20 AC 136 ms
40,784 KB
testcase_21 AC 142 ms
41,432 KB
testcase_22 AC 153 ms
41,428 KB
testcase_23 AC 141 ms
41,652 KB
testcase_24 AC 143 ms
40,872 KB
testcase_25 AC 143 ms
41,376 KB
testcase_26 AC 140 ms
41,628 KB
testcase_27 AC 140 ms
41,556 KB
testcase_28 AC 143 ms
41,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		double n =sc.nextDouble();
		double a = sc.nextDouble();
		long total = 0;
		for (int i=0; i<n; i++) {
			total += sc.nextInt();
		}
		double average = total/n;
		System.out.println(average==a?"YES":"NO");
	}
}
0