結果

問題 No.476 正しくない平均
ユーザー YamaKasaYamaKasa
提出日時 2018-05-06 01:36:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 399 bytes
コンパイル時間 2,023 ms
コンパイル使用メモリ 71,584 KB
実行使用メモリ 56,280 KB
最終ジャッジ日時 2023-09-10 10:41:00
合計ジャッジ時間 7,121 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,008 KB
testcase_01 AC 126 ms
55,512 KB
testcase_02 AC 128 ms
55,832 KB
testcase_03 AC 126 ms
55,876 KB
testcase_04 AC 126 ms
55,760 KB
testcase_05 AC 124 ms
55,896 KB
testcase_06 AC 127 ms
55,532 KB
testcase_07 AC 125 ms
55,540 KB
testcase_08 AC 125 ms
56,096 KB
testcase_09 AC 125 ms
56,032 KB
testcase_10 AC 125 ms
55,736 KB
testcase_11 AC 125 ms
55,948 KB
testcase_12 AC 127 ms
56,104 KB
testcase_13 AC 127 ms
56,184 KB
testcase_14 AC 126 ms
56,048 KB
testcase_15 AC 126 ms
55,892 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 126 ms
55,972 KB
testcase_20 AC 128 ms
55,876 KB
testcase_21 AC 128 ms
55,976 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 127 ms
56,020 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 126 ms
56,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		long a = scan.nextLong();
		long sum = 0;
		for(int i = 0; i < n; i++) {
			sum +=  scan.nextLong();
		}
		scan.close();
		float m = (float)sum / n;
		if(m == a) {
			System.out.println("YES");
		}else {
			System.out.println("NO");
		}
	}
}
0