結果

問題 No.476 正しくない平均
ユーザー FVRChanFVRChan
提出日時 2017-10-03 10:03:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 2,526 ms
コンパイル使用メモリ 70,876 KB
実行使用メモリ 40,160 KB
最終ジャッジ日時 2023-08-10 05:18:57
合計ジャッジ時間 7,040 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
39,312 KB
testcase_01 WA -
testcase_02 AC 117 ms
39,604 KB
testcase_03 AC 111 ms
39,540 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 122 ms
39,484 KB
testcase_07 AC 122 ms
39,440 KB
testcase_08 AC 118 ms
39,832 KB
testcase_09 AC 107 ms
39,320 KB
testcase_10 AC 111 ms
39,360 KB
testcase_11 WA -
testcase_12 AC 104 ms
39,324 KB
testcase_13 AC 110 ms
39,164 KB
testcase_14 AC 111 ms
39,504 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 107 ms
39,040 KB
testcase_19 AC 112 ms
39,680 KB
testcase_20 AC 109 ms
39,744 KB
testcase_21 WA -
testcase_22 AC 110 ms
39,268 KB
testcase_23 AC 107 ms
39,368 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 109 ms
39,732 KB
testcase_27 WA -
testcase_28 AC 109 ms
39,748 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