結果
問題 |
No.476 正しくない平均
|
ユーザー |
|
提出日時 | 2017-02-18 01:26:32 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 3,949 ms |
コンパイル使用メモリ | 77,668 KB |
実行使用メモリ | 41,296 KB |
最終ジャッジ日時 | 2024-12-30 03:07:46 |
合計ジャッジ時間 | 9,091 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 == ave) System.out.println("yes"); else System.out.println("no"); } }