結果

問題 No.476 正しくない平均
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-05-04 08:37:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 739 bytes
コンパイル時間 1,988 ms
コンパイル使用メモリ 71,648 KB
実行使用メモリ 49,736 KB
最終ジャッジ日時 2023-10-12 07:01:16
合計ジャッジ時間 4,536 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,180 KB
testcase_01 AC 42 ms
49,316 KB
testcase_02 AC 42 ms
49,380 KB
testcase_03 AC 44 ms
49,364 KB
testcase_04 AC 42 ms
49,160 KB
testcase_05 AC 42 ms
49,188 KB
testcase_06 AC 42 ms
49,508 KB
testcase_07 AC 43 ms
49,452 KB
testcase_08 AC 42 ms
49,244 KB
testcase_09 AC 42 ms
49,144 KB
testcase_10 AC 42 ms
47,180 KB
testcase_11 AC 43 ms
49,340 KB
testcase_12 AC 44 ms
49,264 KB
testcase_13 AC 45 ms
49,372 KB
testcase_14 AC 43 ms
49,408 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 42 ms
49,364 KB
testcase_19 WA -
testcase_20 AC 42 ms
49,552 KB
testcase_21 WA -
testcase_22 AC 42 ms
49,376 KB
testcase_23 AC 42 ms
49,280 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 42 ms
49,240 KB
testcase_27 WA -
testcase_28 AC 45 ms
49,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String[] inputs = reader.readLine().split(" ");
        int n = Integer.parseInt(inputs[0]);
        int a = Integer.parseInt(inputs[1]);
        inputs = reader.readLine().split(" ");
        long sum = 0;
        for (int i = 0; i < n; i++) {
            sum += Long.parseLong(inputs[i]);
        }
        if((a*n) == sum) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}
0