結果
問題 |
No.476 正しくない平均
|
ユーザー |
![]() |
提出日時 | 2017-10-03 10:03:09 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 357 bytes |
コンパイル時間 | 2,100 ms |
コンパイル使用メモリ | 74,816 KB |
実行使用メモリ | 41,572 KB |
最終ジャッジ日時 | 2024-11-16 05:33:01 |
合計ジャッジ時間 | 6,260 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 16 WA * 10 |
ソースコード
import java.util.Scanner; public class Main{ private static Scanner sc=new Scanner(System.in); public static void main(String args[])throws Exception{ int n=sc.nextInt(),a=sc.nextInt(),sum=0; for(int i=0;i<n;i++){ sum+=sc.nextInt(); }double abe=Math.round(sum*1.0/n); if(abe == a)System.out.println("YES"); else System.out.println("NO"); } }