結果

問題 No.476 正しくない平均
ユーザー yamax3232
提出日時 2017-02-09 21:36:52
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 467 bytes
コンパイル時間 3,644 ms
コンパイル使用メモリ 75,308 KB
実行使用メモリ 41,512 KB
最終ジャッジ日時 2024-12-26 02:18:42
合計ジャッジ時間 8,251 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Average476 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner kb=new Scanner(System.in);
		int n=kb.nextInt();
		int a=kb.nextInt();
		int[] c={0,0,0,0,0,0,0,0,0,0,0};
		int sum=0;
		for(int i=1;i<=n;i++){
			c[i-1]=kb.nextInt();
			sum+=c[i-1];
		}
		if((double)sum/n==a){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
		kb.close();

	}

}
0