結果

問題 No.476 正しくない平均
ユーザー YOSHIYOSHI
提出日時 2021-03-16 22:36:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 3,656 ms
コンパイル使用メモリ 74,896 KB
実行使用メモリ 37,284 KB
最終ジャッジ日時 2024-04-26 05:26:03
合計ジャッジ時間 5,653 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
36,808 KB
testcase_01 AC 53 ms
37,120 KB
testcase_02 AC 52 ms
37,188 KB
testcase_03 AC 51 ms
37,124 KB
testcase_04 AC 52 ms
36,716 KB
testcase_05 AC 51 ms
37,284 KB
testcase_06 AC 52 ms
37,144 KB
testcase_07 AC 50 ms
36,716 KB
testcase_08 AC 52 ms
37,064 KB
testcase_09 AC 51 ms
37,188 KB
testcase_10 AC 52 ms
36,716 KB
testcase_11 AC 50 ms
37,284 KB
testcase_12 AC 52 ms
37,276 KB
testcase_13 AC 52 ms
36,848 KB
testcase_14 AC 54 ms
37,004 KB
testcase_15 AC 52 ms
36,968 KB
testcase_16 AC 50 ms
37,184 KB
testcase_17 AC 51 ms
37,268 KB
testcase_18 AC 54 ms
37,152 KB
testcase_19 AC 51 ms
37,184 KB
testcase_20 AC 51 ms
37,208 KB
testcase_21 AC 51 ms
37,180 KB
testcase_22 AC 50 ms
37,040 KB
testcase_23 AC 50 ms
37,140 KB
testcase_24 AC 51 ms
37,176 KB
testcase_25 AC 52 ms
36,808 KB
testcase_26 AC 52 ms
37,224 KB
testcase_27 AC 55 ms
37,000 KB
testcase_28 AC 53 ms
36,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No00000476_Main {
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static void main(String[] args) throws IOException {
		String[] t = br.readLine().split(" ");
		int n = Integer.parseInt(t[0]);
		String[] x = br.readLine().split(" ");
		long sum = 0;
		for(int i = 0; i < n; i++) sum += Integer.parseInt(x[i]);
		System.out.println(n * Long.parseLong(t[1]) == sum ? "YES" : "NO");
	}
}
0