結果
| 問題 | No.476 正しくない平均 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-09 16:33:12 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 412 bytes |
| 記録 | |
| コンパイル時間 | 1,737 ms |
| コンパイル使用メモリ | 84,344 KB |
| 実行使用メモリ | 46,788 KB |
| 最終ジャッジ日時 | 2026-03-11 00:48:36 |
| 合計ジャッジ時間 | 4,346 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 7 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int sample = sc.nextInt();
int sum = 0;
for (int i = 0; i < n; i++) {
sum += sc.nextInt();
}
double avg = (double)sum / n;
if (avg == sample) {
System.out.println("YES");
} else {
System.out.println("NO");
}
sc.close();
}
}