結果

問題 No.476 正しくない平均
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-19 19:49:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 1,916 ms
コンパイル使用メモリ 74,592 KB
実行使用メモリ 54,388 KB
最終ジャッジ日時 2024-04-10 06:08:18
合計ジャッジ時間 6,662 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
52,840 KB
testcase_01 AC 126 ms
54,148 KB
testcase_02 AC 128 ms
54,116 KB
testcase_03 AC 113 ms
53,080 KB
testcase_04 AC 126 ms
53,968 KB
testcase_05 AC 126 ms
54,388 KB
testcase_06 AC 127 ms
54,352 KB
testcase_07 AC 114 ms
52,796 KB
testcase_08 AC 113 ms
53,152 KB
testcase_09 AC 113 ms
52,708 KB
testcase_10 AC 124 ms
54,104 KB
testcase_11 AC 124 ms
54,044 KB
testcase_12 AC 126 ms
53,964 KB
testcase_13 AC 115 ms
53,136 KB
testcase_14 AC 126 ms
54,032 KB
testcase_15 AC 115 ms
53,072 KB
testcase_16 AC 115 ms
53,012 KB
testcase_17 AC 118 ms
53,412 KB
testcase_18 AC 127 ms
54,004 KB
testcase_19 AC 127 ms
54,216 KB
testcase_20 AC 121 ms
54,236 KB
testcase_21 AC 128 ms
54,160 KB
testcase_22 AC 126 ms
54,052 KB
testcase_23 AC 127 ms
53,980 KB
testcase_24 AC 115 ms
52,980 KB
testcase_25 AC 129 ms
54,212 KB
testcase_26 AC 126 ms
53,892 KB
testcase_27 AC 124 ms
53,932 KB
testcase_28 AC 125 ms
53,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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