結果

問題 No.476 正しくない平均
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2017-01-27 23:44:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 3,186 ms
コンパイル使用メモリ 71,376 KB
実行使用メモリ 56,352 KB
最終ジャッジ日時 2023-08-25 11:08:00
合計ジャッジ時間 7,923 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,120 KB
testcase_01 WA -
testcase_02 AC 127 ms
55,772 KB
testcase_03 AC 123 ms
55,888 KB
testcase_04 AC 122 ms
56,012 KB
testcase_05 WA -
testcase_06 AC 124 ms
56,252 KB
testcase_07 AC 122 ms
56,096 KB
testcase_08 AC 123 ms
56,020 KB
testcase_09 AC 124 ms
55,796 KB
testcase_10 AC 126 ms
55,844 KB
testcase_11 WA -
testcase_12 AC 122 ms
55,692 KB
testcase_13 AC 123 ms
56,000 KB
testcase_14 AC 124 ms
55,800 KB
testcase_15 AC 126 ms
56,188 KB
testcase_16 AC 123 ms
53,872 KB
testcase_17 AC 126 ms
56,348 KB
testcase_18 AC 124 ms
55,804 KB
testcase_19 AC 124 ms
55,920 KB
testcase_20 WA -
testcase_21 AC 124 ms
55,844 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 125 ms
56,028 KB
testcase_25 AC 122 ms
56,352 KB
testcase_26 WA -
testcase_27 AC 122 ms
56,088 KB
testcase_28 AC 121 ms
56,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static long mod = (long)Math.pow(10,6);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int a = sc.nextInt();
        long sum=0;
        for(int i=0; i<N; i++){
            int tmp = sc.nextInt();
            sum+=tmp;
        }
        double ave = sum/N;
        if(ave==a){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
}
0