結果

問題 No.476 正しくない平均
ユーザー Tsukasa_Type
提出日時 2018-02-10 15:26:49
言語 Java
(openjdk 23)
結果
AC  
実行時間 149 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 2,149 ms
コンパイル使用メモリ 74,100 KB
実行使用メモリ 41,772 KB
最終ジャッジ日時 2024-10-13 13:31:35
合計ジャッジ時間 7,258 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		double n =sc.nextDouble();
		double a = sc.nextDouble();
		long total = 0;
		for (int i=0; i<n; i++) {
			total += sc.nextInt();
		}
		double average = total/n;
		System.out.println(average==a?"YES":"NO");
	}
}
0