結果

問題 No.476 正しくない平均
ユーザー FVRChanFVRChan
提出日時 2017-10-03 10:03:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 1,722 ms
コンパイル使用メモリ 74,648 KB
実行使用メモリ 54,440 KB
最終ジャッジ日時 2024-04-27 22:38:04
合計ジャッジ時間 5,718 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
54,088 KB
testcase_01 WA -
testcase_02 AC 106 ms
53,064 KB
testcase_03 AC 101 ms
52,640 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 111 ms
53,864 KB
testcase_07 AC 97 ms
52,864 KB
testcase_08 AC 104 ms
54,076 KB
testcase_09 AC 98 ms
52,960 KB
testcase_10 AC 113 ms
53,784 KB
testcase_11 WA -
testcase_12 AC 109 ms
53,660 KB
testcase_13 AC 102 ms
52,700 KB
testcase_14 AC 117 ms
54,236 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 110 ms
54,048 KB
testcase_19 AC 101 ms
52,648 KB
testcase_20 AC 109 ms
53,908 KB
testcase_21 WA -
testcase_22 AC 101 ms
52,708 KB
testcase_23 AC 112 ms
54,116 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 100 ms
52,936 KB
testcase_27 WA -
testcase_28 AC 115 ms
53,860 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=Math.round(sum*1.0/n);
		if(abe == a)System.out.println("YES");
		else System.out.println("NO");
	}
}
0