結果

問題 No.476 正しくない平均
ユーザー samplelpmassamplelpmas
提出日時 2017-01-28 16:25:21
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 3,063 ms
コンパイル使用メモリ 71,712 KB
実行使用メモリ 56,120 KB
最終ジャッジ日時 2023-08-25 13:13:57
合計ジャッジ時間 6,712 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
55,924 KB
testcase_01 AC 103 ms
56,120 KB
testcase_02 AC 111 ms
55,396 KB
testcase_03 AC 110 ms
55,728 KB
testcase_04 AC 113 ms
55,580 KB
testcase_05 AC 116 ms
55,740 KB
testcase_06 AC 119 ms
55,860 KB
testcase_07 AC 117 ms
55,868 KB
testcase_08 AC 113 ms
55,884 KB
testcase_09 AC 114 ms
55,744 KB
testcase_10 AC 111 ms
55,660 KB
testcase_11 AC 105 ms
55,928 KB
testcase_12 AC 110 ms
55,448 KB
testcase_13 AC 109 ms
55,912 KB
testcase_14 AC 110 ms
56,120 KB
testcase_15 AC 114 ms
55,852 KB
testcase_16 AC 105 ms
55,952 KB
testcase_17 AC 106 ms
55,812 KB
testcase_18 AC 110 ms
55,960 KB
testcase_19 WA -
testcase_20 AC 118 ms
55,604 KB
testcase_21 AC 109 ms
55,600 KB
testcase_22 AC 117 ms
55,640 KB
testcase_23 AC 106 ms
55,976 KB
testcase_24 AC 106 ms
56,072 KB
testcase_25 AC 118 ms
55,984 KB
testcase_26 AC 105 ms
55,892 KB
testcase_27 AC 102 ms
56,068 KB
testcase_28 AC 107 ms
55,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int answer = sc.nextInt();

        int sum = 0;

        for (int i = 0; i < n; i++) {
            sum += sc.nextInt();
        }

        System.out.println(sum == answer * n ? "YES" : "NO");

    }

}
0