結果

問題 No.476 正しくない平均
ユーザー yamax3232yamax3232
提出日時 2017-02-09 21:36:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 467 bytes
コンパイル時間 3,209 ms
コンパイル使用メモリ 71,532 KB
実行使用メモリ 56,400 KB
最終ジャッジ日時 2023-08-26 22:45:22
合計ジャッジ時間 8,281 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
55,952 KB
testcase_01 AC 114 ms
55,828 KB
testcase_02 AC 114 ms
56,020 KB
testcase_03 AC 112 ms
56,244 KB
testcase_04 AC 117 ms
55,640 KB
testcase_05 AC 107 ms
55,992 KB
testcase_06 AC 110 ms
56,140 KB
testcase_07 AC 112 ms
56,180 KB
testcase_08 AC 114 ms
56,044 KB
testcase_09 AC 114 ms
56,268 KB
testcase_10 AC 113 ms
55,972 KB
testcase_11 AC 115 ms
55,852 KB
testcase_12 AC 119 ms
56,012 KB
testcase_13 AC 121 ms
55,720 KB
testcase_14 AC 113 ms
55,648 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 111 ms
55,572 KB
testcase_19 AC 121 ms
55,992 KB
testcase_20 AC 112 ms
55,852 KB
testcase_21 WA -
testcase_22 AC 112 ms
56,400 KB
testcase_23 AC 117 ms
56,168 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 114 ms
56,400 KB
testcase_27 WA -
testcase_28 AC 111 ms
55,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Average476 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner kb=new Scanner(System.in);
		int n=kb.nextInt();
		int a=kb.nextInt();
		int[] c={0,0,0,0,0,0,0,0,0,0,0};
		int sum=0;
		for(int i=1;i<=n;i++){
			c[i-1]=kb.nextInt();
			sum+=c[i-1];
		}
		if((double)sum/n==a){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
		kb.close();

	}

}
0