結果

問題 No.476 正しくない平均
ユーザー tentententen
提出日時 2020-11-11 17:27:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 3,542 ms
コンパイル使用メモリ 76,572 KB
実行使用メモリ 56,500 KB
最終ジャッジ日時 2023-09-30 00:35:53
合計ジャッジ時間 7,126 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,864 KB
testcase_01 AC 118 ms
55,872 KB
testcase_02 AC 120 ms
56,176 KB
testcase_03 AC 119 ms
55,428 KB
testcase_04 AC 122 ms
55,984 KB
testcase_05 AC 117 ms
56,116 KB
testcase_06 AC 120 ms
55,740 KB
testcase_07 AC 119 ms
55,976 KB
testcase_08 AC 120 ms
56,408 KB
testcase_09 AC 120 ms
55,504 KB
testcase_10 AC 120 ms
55,520 KB
testcase_11 AC 121 ms
55,980 KB
testcase_12 AC 121 ms
56,124 KB
testcase_13 AC 123 ms
55,900 KB
testcase_14 AC 120 ms
55,896 KB
testcase_15 AC 120 ms
56,128 KB
testcase_16 AC 120 ms
56,160 KB
testcase_17 AC 118 ms
55,764 KB
testcase_18 AC 119 ms
56,128 KB
testcase_19 AC 122 ms
56,500 KB
testcase_20 AC 119 ms
55,580 KB
testcase_21 AC 119 ms
56,024 KB
testcase_22 AC 119 ms
56,016 KB
testcase_23 AC 119 ms
55,860 KB
testcase_24 AC 119 ms
56,436 KB
testcase_25 AC 118 ms
55,960 KB
testcase_26 AC 118 ms
55,600 KB
testcase_27 AC 119 ms
55,912 KB
testcase_28 AC 121 ms
55,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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