結果

問題 No.476 正しくない平均
ユーザー fukuseifukusei
提出日時 2017-05-20 22:16:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 3,484 ms
コンパイル使用メモリ 74,524 KB
実行使用メモリ 57,828 KB
最終ジャッジ日時 2023-10-19 04:15:26
合計ジャッジ時間 8,523 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
57,544 KB
testcase_01 AC 139 ms
57,804 KB
testcase_02 AC 143 ms
57,564 KB
testcase_03 AC 138 ms
57,508 KB
testcase_04 AC 141 ms
55,724 KB
testcase_05 AC 135 ms
57,664 KB
testcase_06 AC 136 ms
57,516 KB
testcase_07 AC 136 ms
57,480 KB
testcase_08 AC 137 ms
57,616 KB
testcase_09 AC 137 ms
57,556 KB
testcase_10 AC 139 ms
57,576 KB
testcase_11 AC 137 ms
57,828 KB
testcase_12 AC 137 ms
57,544 KB
testcase_13 AC 136 ms
57,508 KB
testcase_14 AC 139 ms
57,796 KB
testcase_15 AC 136 ms
57,764 KB
testcase_16 AC 139 ms
57,200 KB
testcase_17 AC 136 ms
57,688 KB
testcase_18 AC 137 ms
57,556 KB
testcase_19 AC 136 ms
57,508 KB
testcase_20 AC 136 ms
57,576 KB
testcase_21 AC 136 ms
57,536 KB
testcase_22 AC 136 ms
57,800 KB
testcase_23 AC 140 ms
57,460 KB
testcase_24 AC 138 ms
57,480 KB
testcase_25 AC 137 ms
57,220 KB
testcase_26 AC 138 ms
57,520 KB
testcase_27 AC 143 ms
57,064 KB
testcase_28 AC 136 ms
57,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*; 

public class test {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long n = sc.nextInt();
		long a = sc.nextInt();
		long 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