結果

問題 No.476 正しくない平均
ユーザー swdamdr
提出日時 2017-01-31 11:01:57
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 3,426 ms
コンパイル使用メモリ 74,372 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2024-12-23 22:16:16
合計ジャッジ時間 8,576 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Sample01 {

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