結果

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

ソースコード

diff #

import java.util.*;

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