結果
問題 |
No.476 正しくない平均
|
ユーザー |
|
提出日時 | 2017-01-28 01:33:28 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 151 ms / 2,000 ms |
コード長 | 553 bytes |
コンパイル時間 | 3,333 ms |
コンパイル使用メモリ | 76,184 KB |
実行使用メモリ | 41,760 KB |
最終ジャッジ日時 | 2024-12-24 09:55:15 |
合計ジャッジ時間 | 7,607 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
import java.io.PrintWriter; import java.util.*; import java.util.concurrent.SynchronousQueue; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long a = sc.nextLong(); long[] x = new long[n]; long s = 0; for (int i = 0; i < n; ++i) { x[i] = sc.nextLong(); s += x[i]; } if (a * n == s) { System.out.println("YES"); } else { System.out.println("NO"); } } static void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }