結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 136 ms
41,044 KB
testcase_02 AC 137 ms
41,160 KB
testcase_03 WA -
testcase_04 AC 132 ms
41,200 KB
testcase_05 AC 131 ms
41,248 KB
testcase_06 AC 126 ms
41,460 KB
testcase_07 AC 113 ms
40,132 KB
testcase_08 AC 116 ms
39,756 KB
testcase_09 AC 132 ms
41,036 KB
testcase_10 AC 137 ms
41,216 KB
testcase_11 AC 119 ms
39,688 KB
testcase_12 AC 133 ms
40,796 KB
testcase_13 AC 122 ms
40,364 KB
testcase_14 AC 131 ms
41,280 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 127 ms
41,104 KB
testcase_19 AC 127 ms
40,828 KB
testcase_20 AC 133 ms
41,344 KB
testcase_21 WA -
testcase_22 AC 121 ms
39,944 KB
testcase_23 AC 133 ms
41,232 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 130 ms
41,456 KB
testcase_27 WA -
testcase_28 AC 112 ms
40,048 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 * n == a) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}
0