結果
問題 |
No.476 正しくない平均
|
ユーザー |
![]() |
提出日時 | 2017-05-04 08:37:55 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 739 bytes |
コンパイル時間 | 2,190 ms |
コンパイル使用メモリ | 74,092 KB |
実行使用メモリ | 50,208 KB |
最終ジャッジ日時 | 2024-09-14 06:18:14 |
合計ジャッジ時間 | 4,684 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 8 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String[] inputs = reader.readLine().split(" "); int n = Integer.parseInt(inputs[0]); int a = Integer.parseInt(inputs[1]); inputs = reader.readLine().split(" "); long sum = 0; for (int i = 0; i < n; i++) { sum += Long.parseLong(inputs[i]); } if((a*n) == sum) { System.out.println("YES"); } else { System.out.println("NO"); } } }