結果

問題 No.476 正しくない平均
ユーザー fukusei
提出日時 2017-05-20 22:13:44
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 3,440 ms
コンパイル使用メモリ 74,752 KB
実行使用メモリ 41,716 KB
最終ジャッジ日時 2024-09-19 00:30:51
合計ジャッジ時間 8,265 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*; 

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