結果

問題 No.476 正しくない平均
ユーザー FVRChanFVRChan
提出日時 2017-10-03 10:02:07
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 2,207 ms
コンパイル使用メモリ 71,920 KB
実行使用メモリ 56,392 KB
最終ジャッジ日時 2023-08-10 05:18:31
合計ジャッジ時間 7,393 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
38,868 KB
testcase_01 AC 108 ms
39,508 KB
testcase_02 AC 108 ms
39,684 KB
testcase_03 AC 109 ms
39,404 KB
testcase_04 AC 108 ms
39,464 KB
testcase_05 AC 108 ms
39,584 KB
testcase_06 AC 107 ms
39,464 KB
testcase_07 AC 104 ms
39,380 KB
testcase_08 AC 110 ms
39,740 KB
testcase_09 AC 110 ms
39,480 KB
testcase_10 AC 109 ms
39,536 KB
testcase_11 AC 107 ms
39,472 KB
testcase_12 AC 111 ms
39,644 KB
testcase_13 AC 110 ms
39,632 KB
testcase_14 AC 112 ms
39,652 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 110 ms
39,240 KB
testcase_19 AC 110 ms
39,708 KB
testcase_20 AC 121 ms
39,328 KB
testcase_21 WA -
testcase_22 AC 109 ms
39,352 KB
testcase_23 AC 115 ms
39,468 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 115 ms
39,360 KB
testcase_27 WA -
testcase_28 AC 113 ms
39,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main{
	private static Scanner sc=new Scanner(System.in);
	public static void main(String args[])throws Exception{
		int n=sc.nextInt(),a=sc.nextInt(),sum=0;
		for(int i=0;i<n;i++){
			sum+=sc.nextInt();
		}double abe=sum*1.0/n;
		if(abe == a)System.out.println("YES");
		else System.out.println("NO");
	}
}
0