結果

問題 No.476 正しくない平均
ユーザー HEGO55HEGO55
提出日時 2017-05-20 12:27:30
言語 Java19
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 2,580 ms
コンパイル使用メモリ 74,544 KB
実行使用メモリ 57,800 KB
最終ジャッジ日時 2023-10-19 04:10:52
合計ジャッジ時間 7,143 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
57,540 KB
testcase_01 AC 135 ms
57,564 KB
testcase_02 AC 134 ms
57,720 KB
testcase_03 AC 134 ms
57,524 KB
testcase_04 AC 135 ms
57,432 KB
testcase_05 AC 132 ms
57,484 KB
testcase_06 AC 130 ms
57,492 KB
testcase_07 AC 134 ms
57,540 KB
testcase_08 AC 140 ms
57,776 KB
testcase_09 AC 141 ms
57,696 KB
testcase_10 AC 134 ms
57,584 KB
testcase_11 AC 134 ms
57,360 KB
testcase_12 AC 135 ms
57,404 KB
testcase_13 AC 137 ms
57,544 KB
testcase_14 AC 135 ms
57,712 KB
testcase_15 AC 135 ms
55,676 KB
testcase_16 AC 135 ms
57,640 KB
testcase_17 AC 137 ms
57,680 KB
testcase_18 AC 134 ms
57,668 KB
testcase_19 AC 137 ms
57,660 KB
testcase_20 AC 138 ms
57,644 KB
testcase_21 AC 135 ms
55,720 KB
testcase_22 AC 133 ms
57,800 KB
testcase_23 AC 134 ms
55,728 KB
testcase_24 AC 134 ms
57,556 KB
testcase_25 AC 130 ms
57,172 KB
testcase_26 AC 134 ms
57,724 KB
testcase_27 AC 136 ms
57,460 KB
testcase_28 AC 136 ms
57,608 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();
		double 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