結果

問題 No.476 正しくない平均
ユーザー cande398cande398
提出日時 2017-10-08 14:58:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 74,176 KB
実行使用メモリ 54,424 KB
最終ジャッジ日時 2024-04-28 13:25:13
合計ジャッジ時間 7,481 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
54,148 KB
testcase_01 AC 151 ms
53,832 KB
testcase_02 AC 152 ms
54,052 KB
testcase_03 AC 143 ms
54,100 KB
testcase_04 AC 142 ms
54,292 KB
testcase_05 AC 126 ms
53,240 KB
testcase_06 AC 141 ms
54,160 KB
testcase_07 AC 147 ms
54,084 KB
testcase_08 AC 148 ms
54,108 KB
testcase_09 AC 144 ms
54,124 KB
testcase_10 AC 142 ms
53,964 KB
testcase_11 AC 143 ms
54,424 KB
testcase_12 AC 144 ms
54,360 KB
testcase_13 AC 131 ms
53,624 KB
testcase_14 AC 153 ms
54,168 KB
testcase_15 AC 147 ms
54,244 KB
testcase_16 AC 144 ms
54,244 KB
testcase_17 AC 148 ms
53,956 KB
testcase_18 AC 149 ms
54,132 KB
testcase_19 AC 130 ms
53,612 KB
testcase_20 AC 150 ms
54,220 KB
testcase_21 AC 145 ms
54,092 KB
testcase_22 AC 132 ms
53,292 KB
testcase_23 AC 146 ms
54,184 KB
testcase_24 AC 150 ms
54,100 KB
testcase_25 AC 127 ms
52,956 KB
testcase_26 AC 145 ms
54,084 KB
testcase_27 AC 138 ms
54,132 KB
testcase_28 AC 139 ms
53,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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