結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,832 KB
testcase_01 AC 128 ms
55,492 KB
testcase_02 AC 128 ms
55,632 KB
testcase_03 AC 126 ms
55,948 KB
testcase_04 AC 125 ms
55,648 KB
testcase_05 AC 127 ms
55,400 KB
testcase_06 AC 126 ms
55,628 KB
testcase_07 AC 126 ms
55,564 KB
testcase_08 AC 127 ms
55,792 KB
testcase_09 AC 127 ms
55,764 KB
testcase_10 AC 127 ms
55,800 KB
testcase_11 AC 127 ms
55,528 KB
testcase_12 AC 127 ms
55,632 KB
testcase_13 AC 128 ms
55,604 KB
testcase_14 AC 127 ms
55,828 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 129 ms
55,644 KB
testcase_19 AC 124 ms
55,416 KB
testcase_20 AC 127 ms
55,300 KB
testcase_21 WA -
testcase_22 AC 127 ms
55,820 KB
testcase_23 AC 126 ms
55,488 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 127 ms
55,708 KB
testcase_27 WA -
testcase_28 AC 127 ms
55,596 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