結果

問題 No.476 正しくない平均
ユーザー HEGO55
提出日時 2017-05-20 12:24:14
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 2,488 ms
コンパイル使用メモリ 74,016 KB
実行使用メモリ 41,492 KB
最終ジャッジ日時 2024-09-19 00:26:34
合計ジャッジ時間 7,650 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 17 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class No476{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int a = sc.nextInt();
		int sum = 0;
		double ave = 0;
		
		for(int i=0; i<N; i++){
			int No = sc.nextInt();
			sum += No;
			ave = sum/N;
		}
		
		if(a == ave){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}
0