結果

問題 No.476 正しくない平均
ユーザー bellbell
提出日時 2021-02-20 17:45:39
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 3,420 ms
コンパイル使用メモリ 74,788 KB
実行使用メモリ 57,940 KB
最終ジャッジ日時 2023-10-18 22:20:54
合計ジャッジ時間 9,263 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
57,300 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 139 ms
57,340 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 134 ms
57,340 KB
testcase_09 AC 135 ms
57,460 KB
testcase_10 AC 136 ms
57,332 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 136 ms
57,340 KB
testcase_16 AC 136 ms
57,564 KB
testcase_17 AC 134 ms
56,960 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 139 ms
57,100 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 137 ms
57,288 KB
testcase_25 AC 140 ms
57,344 KB
testcase_26 WA -
testcase_27 AC 139 ms
57,556 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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