結果

問題 No.476 正しくない平均
ユーザー htensaihtensai
提出日時 2019-11-19 08:27:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 363 bytes
コンパイル時間 2,161 ms
コンパイル使用メモリ 74,264 KB
実行使用メモリ 54,684 KB
最終ジャッジ日時 2024-04-14 09:20:08
合計ジャッジ時間 7,250 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
54,376 KB
testcase_01 AC 133 ms
54,108 KB
testcase_02 AC 136 ms
54,684 KB
testcase_03 AC 132 ms
53,872 KB
testcase_04 AC 135 ms
54,092 KB
testcase_05 AC 132 ms
54,168 KB
testcase_06 AC 134 ms
54,008 KB
testcase_07 AC 132 ms
53,948 KB
testcase_08 AC 134 ms
54,080 KB
testcase_09 AC 134 ms
54,280 KB
testcase_10 AC 135 ms
54,148 KB
testcase_11 AC 140 ms
53,848 KB
testcase_12 AC 133 ms
54,128 KB
testcase_13 AC 137 ms
54,432 KB
testcase_14 AC 136 ms
54,292 KB
testcase_15 AC 135 ms
54,344 KB
testcase_16 AC 136 ms
53,864 KB
testcase_17 AC 139 ms
54,340 KB
testcase_18 AC 137 ms
54,292 KB
testcase_19 AC 134 ms
53,864 KB
testcase_20 AC 133 ms
54,096 KB
testcase_21 AC 136 ms
54,280 KB
testcase_22 AC 135 ms
53,836 KB
testcase_23 AC 134 ms
54,288 KB
testcase_24 AC 142 ms
54,120 KB
testcase_25 AC 134 ms
54,364 KB
testcase_26 AC 137 ms
54,388 KB
testcase_27 AC 136 ms
54,208 KB
testcase_28 AC 132 ms
54,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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