結果

問題 No.476 正しくない平均
ユーザー cande398cande398
提出日時 2017-10-08 14:58:59
言語 Java19
(openjdk 21)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 3,154 ms
コンパイル使用メモリ 72,536 KB
実行使用メモリ 56,672 KB
最終ジャッジ日時 2023-08-10 20:09:59
合計ジャッジ時間 8,192 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
56,156 KB
testcase_01 AC 134 ms
56,336 KB
testcase_02 AC 138 ms
56,080 KB
testcase_03 AC 134 ms
56,120 KB
testcase_04 AC 134 ms
53,796 KB
testcase_05 AC 130 ms
55,760 KB
testcase_06 AC 134 ms
56,060 KB
testcase_07 AC 134 ms
56,120 KB
testcase_08 AC 134 ms
56,040 KB
testcase_09 AC 134 ms
56,048 KB
testcase_10 AC 136 ms
55,640 KB
testcase_11 AC 131 ms
56,424 KB
testcase_12 AC 131 ms
56,604 KB
testcase_13 AC 134 ms
56,332 KB
testcase_14 AC 135 ms
56,292 KB
testcase_15 AC 136 ms
56,492 KB
testcase_16 AC 139 ms
56,544 KB
testcase_17 AC 140 ms
56,200 KB
testcase_18 AC 137 ms
55,996 KB
testcase_19 AC 135 ms
55,664 KB
testcase_20 AC 137 ms
55,880 KB
testcase_21 AC 137 ms
56,532 KB
testcase_22 AC 134 ms
56,132 KB
testcase_23 AC 137 ms
56,056 KB
testcase_24 AC 137 ms
56,672 KB
testcase_25 AC 135 ms
56,184 KB
testcase_26 AC 134 ms
56,188 KB
testcase_27 AC 136 ms
56,304 KB
testcase_28 AC 135 ms
55,984 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