結果

問題 No.476 正しくない平均
ユーザー yamax3232yamax3232
提出日時 2017-02-15 20:40:06
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 486 bytes
コンパイル時間 2,843 ms
コンパイル使用メモリ 72,020 KB
実行使用メモリ 56,736 KB
最終ジャッジ日時 2023-08-28 17:27:43
合計ジャッジ時間 7,401 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,876 KB
testcase_01 AC 116 ms
56,348 KB
testcase_02 AC 118 ms
56,088 KB
testcase_03 AC 115 ms
55,496 KB
testcase_04 AC 114 ms
56,168 KB
testcase_05 AC 114 ms
55,732 KB
testcase_06 AC 116 ms
56,320 KB
testcase_07 AC 116 ms
55,976 KB
testcase_08 AC 117 ms
55,480 KB
testcase_09 AC 115 ms
55,680 KB
testcase_10 AC 116 ms
55,680 KB
testcase_11 AC 116 ms
56,144 KB
testcase_12 AC 115 ms
55,672 KB
testcase_13 AC 118 ms
56,016 KB
testcase_14 AC 117 ms
55,756 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 118 ms
56,004 KB
testcase_19 AC 115 ms
56,008 KB
testcase_20 AC 116 ms
55,520 KB
testcase_21 WA -
testcase_22 AC 117 ms
55,680 KB
testcase_23 AC 117 ms
55,892 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 116 ms
55,996 KB
testcase_27 WA -
testcase_28 AC 116 ms
56,112 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