結果

問題 No.476 正しくない平均
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-13 16:52:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 2,318 ms
コンパイル使用メモリ 73,120 KB
実行使用メモリ 56,248 KB
最終ジャッジ日時 2023-10-11 11:39:26
合計ジャッジ時間 7,902 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,960 KB
testcase_01 AC 120 ms
54,224 KB
testcase_02 AC 125 ms
56,208 KB
testcase_03 AC 119 ms
56,224 KB
testcase_04 AC 118 ms
55,840 KB
testcase_05 AC 119 ms
55,920 KB
testcase_06 AC 118 ms
55,688 KB
testcase_07 AC 120 ms
56,204 KB
testcase_08 AC 121 ms
55,784 KB
testcase_09 AC 119 ms
55,404 KB
testcase_10 AC 122 ms
55,972 KB
testcase_11 AC 121 ms
55,684 KB
testcase_12 AC 118 ms
56,248 KB
testcase_13 AC 121 ms
56,244 KB
testcase_14 AC 122 ms
56,200 KB
testcase_15 AC 127 ms
55,580 KB
testcase_16 AC 125 ms
56,200 KB
testcase_17 AC 125 ms
56,160 KB
testcase_18 AC 124 ms
55,944 KB
testcase_19 AC 121 ms
55,696 KB
testcase_20 AC 125 ms
55,856 KB
testcase_21 AC 121 ms
55,972 KB
testcase_22 AC 128 ms
55,700 KB
testcase_23 AC 126 ms
55,924 KB
testcase_24 AC 123 ms
55,664 KB
testcase_25 AC 125 ms
55,688 KB
testcase_26 AC 124 ms
55,608 KB
testcase_27 AC 124 ms
56,232 KB
testcase_28 AC 125 ms
55,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		long n = sc.nextLong(); long favg = sc.nextLong();
		Long sum = 0L;
		for (int i=0; i<n; i++) {
			sum += sc.nextInt() * n;
		}
		
		System.out.println(sum/n==favg*n?"YES":"NO");
		
	}
}
0