結果
問題 |
No.476 正しくない平均
|
ユーザー |
![]() |
提出日時 | 2017-03-06 22:23:03 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 506 bytes |
コンパイル時間 | 2,213 ms |
コンパイル使用メモリ | 75,676 KB |
実行使用メモリ | 54,264 KB |
最終ジャッジ日時 | 2024-06-23 11:31:36 |
合計ジャッジ時間 | 7,062 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 7 |
ソースコード
import java.util.Scanner; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int a = in.nextInt(); int sum = 0; for(int i=0; i<n; i++) { sum += in.nextInt(); } if(sum % n == 0 && sum / n == a) System.out.println("YES"); else System.out.println("NO"); in.close(); } }