結果

問題 No.476 正しくない平均
ユーザー tanzakutanzaku
提出日時 2017-01-27 22:21:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 625 bytes
コンパイル時間 7,998 ms
コンパイル使用メモリ 73,268 KB
実行使用メモリ 56,416 KB
最終ジャッジ日時 2023-08-25 22:19:48
合計ジャッジ時間 10,523 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,220 KB
testcase_01 AC 121 ms
55,908 KB
testcase_02 AC 123 ms
55,800 KB
testcase_03 AC 121 ms
56,020 KB
testcase_04 AC 121 ms
56,088 KB
testcase_05 AC 121 ms
56,116 KB
testcase_06 AC 123 ms
55,644 KB
testcase_07 AC 120 ms
55,964 KB
testcase_08 AC 121 ms
56,052 KB
testcase_09 AC 122 ms
55,596 KB
testcase_10 AC 124 ms
56,416 KB
testcase_11 AC 121 ms
55,640 KB
testcase_12 AC 120 ms
55,900 KB
testcase_13 AC 124 ms
56,152 KB
testcase_14 AC 128 ms
53,844 KB
testcase_15 AC 124 ms
56,348 KB
testcase_16 AC 125 ms
56,032 KB
testcase_17 AC 123 ms
55,448 KB
testcase_18 AC 123 ms
56,088 KB
testcase_19 AC 122 ms
55,940 KB
testcase_20 AC 121 ms
55,900 KB
testcase_21 AC 125 ms
56,128 KB
testcase_22 AC 124 ms
55,868 KB
testcase_23 AC 123 ms
56,184 KB
testcase_24 AC 124 ms
56,140 KB
testcase_25 AC 124 ms
55,796 KB
testcase_26 AC 122 ms
56,300 KB
testcase_27 AC 123 ms
56,184 KB
testcase_28 AC 122 ms
56,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class _476 {
	public static void main(String[] args) throws IOException {
		new _476().solve();
	}

	void solve() throws IOException {
		try (final Scanner in = new Scanner(System.in)) {
			int n = in.nextInt();
			long a = in.nextLong();
			long sum = 0;
			for (int i = 0; i < n; i++) sum += in.nextLong();
			System.out.println(sum == a * n ? "YES" : "NO");
		}
	}
	
	// for debug
	static void dump(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}
}
0