結果

問題 No.476 正しくない平均
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-13 11:40:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 421 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 71,232 KB
実行使用メモリ 57,836 KB
最終ジャッジ日時 2023-08-11 00:15:15
合計ジャッジ時間 6,502 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,648 KB
testcase_01 AC 119 ms
55,840 KB
testcase_02 AC 117 ms
55,880 KB
testcase_03 AC 118 ms
56,232 KB
testcase_04 AC 119 ms
55,748 KB
testcase_05 AC 119 ms
55,400 KB
testcase_06 AC 112 ms
56,148 KB
testcase_07 AC 114 ms
55,576 KB
testcase_08 AC 114 ms
55,704 KB
testcase_09 AC 115 ms
57,836 KB
testcase_10 AC 119 ms
55,500 KB
testcase_11 AC 117 ms
55,892 KB
testcase_12 AC 117 ms
56,200 KB
testcase_13 AC 117 ms
56,344 KB
testcase_14 AC 115 ms
55,672 KB
testcase_15 AC 118 ms
56,536 KB
testcase_16 AC 116 ms
55,576 KB
testcase_17 AC 118 ms
55,780 KB
testcase_18 AC 118 ms
55,792 KB
testcase_19 WA -
testcase_20 AC 119 ms
56,068 KB
testcase_21 AC 121 ms
55,540 KB
testcase_22 AC 115 ms
56,392 KB
testcase_23 AC 123 ms
55,684 KB
testcase_24 AC 116 ms
55,896 KB
testcase_25 AC 120 ms
55,836 KB
testcase_26 AC 118 ms
55,976 KB
testcase_27 AC 121 ms
55,872 KB
testcase_28 AC 122 ms
56,088 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