結果

問題 No.476 正しくない平均
ユーザー FVRChanFVRChan
提出日時 2017-10-03 10:02:07
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 2,354 ms
コンパイル使用メモリ 74,360 KB
実行使用メモリ 54,520 KB
最終ジャッジ日時 2024-04-27 22:37:43
合計ジャッジ時間 7,087 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
41,260 KB
testcase_01 AC 127 ms
41,048 KB
testcase_02 AC 133 ms
41,164 KB
testcase_03 AC 128 ms
41,220 KB
testcase_04 AC 128 ms
41,208 KB
testcase_05 AC 134 ms
41,324 KB
testcase_06 AC 133 ms
44,420 KB
testcase_07 AC 129 ms
41,288 KB
testcase_08 AC 116 ms
40,208 KB
testcase_09 AC 137 ms
41,200 KB
testcase_10 AC 140 ms
41,632 KB
testcase_11 AC 139 ms
41,480 KB
testcase_12 AC 147 ms
41,516 KB
testcase_13 AC 139 ms
41,252 KB
testcase_14 AC 143 ms
41,480 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 126 ms
41,240 KB
testcase_19 AC 124 ms
41,144 KB
testcase_20 AC 115 ms
40,248 KB
testcase_21 WA -
testcase_22 AC 132 ms
41,224 KB
testcase_23 AC 129 ms
41,096 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 132 ms
40,896 KB
testcase_27 WA -
testcase_28 AC 126 ms
41,092 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