結果

問題 No.476 正しくない平均
ユーザー HEGO55HEGO55
提出日時 2017-05-20 12:24:14
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 3,617 ms
コンパイル使用メモリ 74,652 KB
実行使用メモリ 57,788 KB
最終ジャッジ日時 2023-10-19 04:10:43
合計ジャッジ時間 8,908 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
57,548 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 132 ms
57,744 KB
testcase_04 AC 135 ms
57,788 KB
testcase_05 WA -
testcase_06 AC 138 ms
57,664 KB
testcase_07 AC 133 ms
57,452 KB
testcase_08 AC 132 ms
57,448 KB
testcase_09 AC 134 ms
57,408 KB
testcase_10 AC 138 ms
57,584 KB
testcase_11 WA -
testcase_12 AC 139 ms
57,576 KB
testcase_13 AC 138 ms
57,460 KB
testcase_14 AC 136 ms
57,544 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 134 ms
57,668 KB
testcase_19 AC 132 ms
57,476 KB
testcase_20 AC 136 ms
57,764 KB
testcase_21 WA -
testcase_22 AC 133 ms
57,476 KB
testcase_23 AC 134 ms
57,504 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 133 ms
57,448 KB
testcase_27 WA -
testcase_28 AC 134 ms
57,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class No476{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int a = sc.nextInt();
		int sum = 0;
		double ave = 0;
		
		for(int i=0; i<N; i++){
			int No = sc.nextInt();
			sum += No;
			ave = sum/N;
		}
		
		if(a == ave){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}
0