結果
問題 |
No.476 正しくない平均
|
ユーザー |
![]() |
提出日時 | 2017-02-20 10:27:31 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 439 bytes |
コンパイル時間 | 2,724 ms |
コンパイル使用メモリ | 73,928 KB |
実行使用メモリ | 41,104 KB |
最終ジャッジ日時 | 2024-12-30 05:58:29 |
合計ジャッジ時間 | 8,218 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 17 WA * 9 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int av = sc.nextInt(); int ar[] = new int[num]; int ans = 0; for(int i=0;i<num;i++){ ans += sc.nextInt(); } int ret = ans/num; if(ret==av){ System.out.println("YES"); }else{ System.out.println("NO"); } } }