結果

問題 No.476 正しくない平均
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-05-04 08:39:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 738 bytes
コンパイル時間 3,307 ms
コンパイル使用メモリ 72,292 KB
実行使用メモリ 49,888 KB
最終ジャッジ日時 2023-10-12 07:01:35
合計ジャッジ時間 4,466 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
49,460 KB
testcase_01 AC 46 ms
49,364 KB
testcase_02 AC 45 ms
47,416 KB
testcase_03 AC 45 ms
49,376 KB
testcase_04 AC 46 ms
49,416 KB
testcase_05 AC 46 ms
49,312 KB
testcase_06 AC 45 ms
49,520 KB
testcase_07 AC 45 ms
49,236 KB
testcase_08 AC 45 ms
49,324 KB
testcase_09 AC 46 ms
49,392 KB
testcase_10 AC 45 ms
47,232 KB
testcase_11 AC 45 ms
49,232 KB
testcase_12 AC 46 ms
49,320 KB
testcase_13 AC 43 ms
49,212 KB
testcase_14 AC 42 ms
49,188 KB
testcase_15 AC 45 ms
49,272 KB
testcase_16 AC 45 ms
49,888 KB
testcase_17 AC 46 ms
49,228 KB
testcase_18 AC 46 ms
49,324 KB
testcase_19 AC 46 ms
49,404 KB
testcase_20 AC 42 ms
49,676 KB
testcase_21 AC 43 ms
49,172 KB
testcase_22 AC 42 ms
49,176 KB
testcase_23 AC 42 ms
49,376 KB
testcase_24 AC 43 ms
49,252 KB
testcase_25 AC 42 ms
49,236 KB
testcase_26 AC 42 ms
49,712 KB
testcase_27 AC 42 ms
49,512 KB
testcase_28 AC 45 ms
49,324 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]);
        long a = Long.parseLong(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