結果

問題 No.476 正しくない平均
ユーザー fukuseifukusei
提出日時 2017-05-20 22:13:44
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 3,512 ms
コンパイル使用メモリ 77,892 KB
実行使用メモリ 57,960 KB
最終ジャッジ日時 2023-10-19 04:15:17
合計ジャッジ時間 8,734 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
57,504 KB
testcase_01 AC 136 ms
57,480 KB
testcase_02 AC 138 ms
57,100 KB
testcase_03 AC 140 ms
57,296 KB
testcase_04 AC 136 ms
57,480 KB
testcase_05 AC 136 ms
57,576 KB
testcase_06 AC 136 ms
57,480 KB
testcase_07 AC 135 ms
57,500 KB
testcase_08 AC 134 ms
57,568 KB
testcase_09 AC 137 ms
57,508 KB
testcase_10 AC 137 ms
57,736 KB
testcase_11 AC 140 ms
57,536 KB
testcase_12 AC 142 ms
55,504 KB
testcase_13 AC 139 ms
57,612 KB
testcase_14 AC 139 ms
57,700 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 135 ms
55,548 KB
testcase_19 AC 134 ms
57,552 KB
testcase_20 AC 138 ms
57,464 KB
testcase_21 WA -
testcase_22 AC 135 ms
57,680 KB
testcase_23 AC 138 ms
57,532 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 137 ms
57,808 KB
testcase_27 WA -
testcase_28 AC 137 ms
57,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*; 

public class test {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		int x = 0;
		
		for(int i=0; i<n; i++){
			x += sc.nextInt();
		}
		
		if((double)x / n == a){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}
	}
}
0