結果

問題 No.476 正しくない平均
ユーザー Mcpu3
提出日時 2018-06-22 01:11:21
言語 Java
(openjdk 23)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 2,073 ms
コンパイル使用メモリ 74,176 KB
実行使用メモリ 41,384 KB
最終ジャッジ日時 2024-06-30 17:49:33
合計ジャッジ時間 6,204 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no476{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n,a,x,i;
		long s=0;
		n=stdIn.nextInt();
		a=stdIn.nextInt();
		for(i=0;i<n;i++) {
			x=stdIn.nextInt();
			s+=x;
		}
		if(s%n==0&&s/n==a) System.out.print("YES");
		else System.out.print("NO");
	}
}
0