結果

問題 No.476 正しくない平均
ユーザー cande398cande398
提出日時 2017-10-08 14:58:59
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 2,915 ms
コンパイル使用メモリ 74,252 KB
実行使用メモリ 41,788 KB
最終ジャッジ日時 2024-11-17 05:31:26
合計ジャッジ時間 7,054 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

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