結果
| 問題 |
No.476 正しくない平均
|
| ユーザー |
YamaKasa
|
| 提出日時 | 2018-05-06 01:36:48 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 399 bytes |
| コンパイル時間 | 2,092 ms |
| コンパイル使用メモリ | 74,648 KB |
| 実行使用メモリ | 41,572 KB |
| 最終ジャッジ日時 | 2024-06-28 02:03:58 |
| 合計ジャッジ時間 | 6,614 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 8 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
long a = scan.nextLong();
long sum = 0;
for(int i = 0; i < n; i++) {
sum += scan.nextLong();
}
scan.close();
float m = (float)sum / n;
if(m == a) {
System.out.println("YES");
}else {
System.out.println("NO");
}
}
}
YamaKasa