結果

問題 No.476 正しくない平均
ユーザー 37zigen37zigen
提出日時 2017-01-28 01:33:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 553 bytes
コンパイル時間 2,166 ms
コンパイル使用メモリ 72,732 KB
実行使用メモリ 56,380 KB
最終ジャッジ日時 2023-08-25 22:35:10
合計ジャッジ時間 6,751 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,776 KB
testcase_01 AC 123 ms
55,520 KB
testcase_02 AC 126 ms
55,764 KB
testcase_03 AC 123 ms
56,072 KB
testcase_04 AC 120 ms
55,680 KB
testcase_05 AC 119 ms
55,636 KB
testcase_06 AC 120 ms
55,716 KB
testcase_07 AC 119 ms
55,592 KB
testcase_08 AC 122 ms
55,940 KB
testcase_09 AC 121 ms
55,824 KB
testcase_10 AC 122 ms
56,156 KB
testcase_11 AC 122 ms
56,100 KB
testcase_12 AC 121 ms
55,860 KB
testcase_13 AC 123 ms
55,876 KB
testcase_14 AC 122 ms
55,960 KB
testcase_15 AC 120 ms
55,764 KB
testcase_16 AC 121 ms
55,860 KB
testcase_17 AC 121 ms
55,796 KB
testcase_18 AC 121 ms
56,068 KB
testcase_19 AC 120 ms
56,380 KB
testcase_20 AC 125 ms
55,656 KB
testcase_21 AC 122 ms
56,096 KB
testcase_22 AC 123 ms
56,036 KB
testcase_23 AC 127 ms
55,560 KB
testcase_24 AC 122 ms
55,520 KB
testcase_25 AC 121 ms
55,704 KB
testcase_26 AC 122 ms
56,172 KB
testcase_27 AC 123 ms
55,868 KB
testcase_28 AC 124 ms
55,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter;
import java.util.*;
import java.util.concurrent.SynchronousQueue;

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

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
0