結果
問題 |
No.476 正しくない平均
|
ユーザー |
|
提出日時 | 2017-02-18 01:29:21 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 491 bytes |
コンパイル時間 | 3,670 ms |
コンパイル使用メモリ | 77,688 KB |
実行使用メモリ | 41,756 KB |
最終ジャッジ日時 | 2024-12-30 03:08:26 |
合計ジャッジ時間 | 8,884 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 26 |
ソースコード
import java.util.Scanner; public class Ex1 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int index = scan.nextInt(); int ave = scan.nextInt(); int[] number = new int[index]; int sum=0; for(int i=0;i<index;i++){ number[i] = scan.nextInt(); } for(int i=0;i<index;i++){ sum += number[i]; } double average = sum/(double)index; if(average == (double)ave) System.out.println("yes"); else System.out.println("no"); } }