結果

問題 No.476 正しくない平均
ユーザー GoryudyumaGoryudyuma
提出日時 2017-04-05 22:40:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 4,731 ms
コンパイル使用メモリ 74,152 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2023-09-22 20:27:21
合計ジャッジ時間 7,891 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
54,460 KB
testcase_01 AC 122 ms
53,952 KB
testcase_02 AC 124 ms
55,724 KB
testcase_03 AC 123 ms
56,068 KB
testcase_04 AC 122 ms
55,680 KB
testcase_05 AC 121 ms
55,412 KB
testcase_06 AC 122 ms
55,380 KB
testcase_07 AC 124 ms
55,528 KB
testcase_08 AC 123 ms
56,240 KB
testcase_09 AC 123 ms
56,248 KB
testcase_10 AC 123 ms
55,880 KB
testcase_11 AC 121 ms
55,660 KB
testcase_12 AC 121 ms
55,812 KB
testcase_13 AC 125 ms
55,592 KB
testcase_14 AC 126 ms
56,072 KB
testcase_15 AC 124 ms
55,588 KB
testcase_16 AC 124 ms
55,916 KB
testcase_17 AC 124 ms
56,172 KB
testcase_18 AC 126 ms
55,988 KB
testcase_19 AC 125 ms
55,496 KB
testcase_20 AC 126 ms
56,224 KB
testcase_21 AC 125 ms
56,164 KB
testcase_22 AC 123 ms
55,980 KB
testcase_23 AC 125 ms
55,800 KB
testcase_24 AC 126 ms
56,316 KB
testcase_25 AC 125 ms
55,880 KB
testcase_26 AC 122 ms
56,044 KB
testcase_27 AC 123 ms
56,328 KB
testcase_28 AC 124 ms
54,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)) {
			long n = sc.nextLong();
		       	long x = sc.nextLong();
			long sum = 0;
			for(int i = 0; i < n; i++) {
				sum += sc.nextLong();
			}
			if(n * x == sum){
				System.out.println("YES");
			} else {
				System.out.println("NO");
			}
		}
	}
}
0