結果

問題 No.476 正しくない平均
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-03-06 22:23:03
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 3,443 ms
コンパイル使用メモリ 72,296 KB
実行使用メモリ 57,588 KB
最終ジャッジ日時 2023-09-05 16:00:45
合計ジャッジ時間 8,434 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,772 KB
testcase_01 AC 121 ms
56,048 KB
testcase_02 AC 124 ms
55,700 KB
testcase_03 AC 122 ms
55,736 KB
testcase_04 AC 121 ms
55,824 KB
testcase_05 AC 123 ms
53,868 KB
testcase_06 AC 122 ms
57,588 KB
testcase_07 AC 123 ms
56,016 KB
testcase_08 AC 124 ms
56,224 KB
testcase_09 AC 122 ms
55,532 KB
testcase_10 AC 122 ms
55,664 KB
testcase_11 AC 122 ms
56,076 KB
testcase_12 AC 122 ms
55,900 KB
testcase_13 AC 124 ms
55,560 KB
testcase_14 AC 125 ms
56,000 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 125 ms
55,984 KB
testcase_19 AC 124 ms
53,888 KB
testcase_20 AC 128 ms
55,792 KB
testcase_21 WA -
testcase_22 AC 124 ms
56,540 KB
testcase_23 AC 122 ms
55,816 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 124 ms
56,108 KB
testcase_27 WA -
testcase_28 AC 121 ms
55,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int a = in.nextInt();
        int sum = 0;
        for(int i=0; i<n; i++) {
            sum += in.nextInt();
        }

        if(sum % n == 0 && sum / n == a) System.out.println("YES");
        else System.out.println("NO");

        in.close();
    }
}
0