結果

問題 No.476 正しくない平均
ユーザー dksnkzk
提出日時 2017-02-18 01:45:30
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 3,787 ms
コンパイル使用メモリ 74,996 KB
実行使用メモリ 54,556 KB
最終ジャッジ日時 2024-12-30 03:11:22
合計ジャッジ時間 9,474 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Ex1
{
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int index = scan.nextInt();
		double ave = scan.nextInt();
		int i = index;
		int sum=0;
		while(i-- != 0){
			sum += scan.nextInt();
		}
		double average = sum/(double)index; 
		if(average == ave)
			System.out.println("yes");
		else 
			System.out.println("no");
	}
}
0