結果
問題 | No.476 正しくない平均 |
ユーザー | YOSHI |
提出日時 | 2021-03-16 22:36:11 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 55 ms / 2,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 3,841 ms |
コンパイル使用メモリ | 73,760 KB |
実行使用メモリ | 37,096 KB |
最終ジャッジ日時 | 2024-11-08 18:10:19 |
合計ジャッジ時間 | 6,114 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
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"); } }