結果

問題 No.476 正しくない平均
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-13 11:40:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 421 bytes
コンパイル時間 2,260 ms
コンパイル使用メモリ 74,584 KB
実行使用メモリ 41,644 KB
最終ジャッジ日時 2024-04-28 17:24:11
合計ジャッジ時間 7,083 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
40,372 KB
testcase_01 AC 116 ms
39,788 KB
testcase_02 AC 132 ms
41,072 KB
testcase_03 AC 133 ms
41,556 KB
testcase_04 AC 129 ms
40,880 KB
testcase_05 AC 128 ms
41,440 KB
testcase_06 AC 129 ms
41,068 KB
testcase_07 AC 130 ms
41,456 KB
testcase_08 AC 130 ms
41,372 KB
testcase_09 AC 128 ms
41,184 KB
testcase_10 AC 138 ms
41,640 KB
testcase_11 AC 132 ms
41,328 KB
testcase_12 AC 130 ms
41,400 KB
testcase_13 AC 120 ms
40,940 KB
testcase_14 AC 118 ms
39,784 KB
testcase_15 AC 136 ms
41,148 KB
testcase_16 AC 135 ms
41,484 KB
testcase_17 AC 124 ms
40,204 KB
testcase_18 AC 136 ms
41,020 KB
testcase_19 WA -
testcase_20 AC 139 ms
41,532 KB
testcase_21 AC 131 ms
41,644 KB
testcase_22 AC 119 ms
39,796 KB
testcase_23 AC 135 ms
40,892 KB
testcase_24 AC 132 ms
41,252 KB
testcase_25 AC 131 ms
41,056 KB
testcase_26 AC 131 ms
41,492 KB
testcase_27 AC 133 ms
41,484 KB
testcase_28 AC 131 ms
41,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

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