結果

問題 No.476 正しくない平均
ユーザー misk703misk703
提出日時 2018-06-04 15:15:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 3,272 ms
コンパイル使用メモリ 74,248 KB
実行使用メモリ 57,968 KB
最終ジャッジ日時 2023-09-12 22:08:58
合計ジャッジ時間 8,118 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,224 KB
testcase_01 AC 122 ms
56,144 KB
testcase_02 AC 123 ms
55,828 KB
testcase_03 AC 121 ms
54,148 KB
testcase_04 AC 123 ms
56,428 KB
testcase_05 AC 123 ms
56,084 KB
testcase_06 AC 120 ms
55,904 KB
testcase_07 AC 122 ms
56,144 KB
testcase_08 AC 121 ms
55,796 KB
testcase_09 AC 122 ms
55,912 KB
testcase_10 AC 122 ms
56,064 KB
testcase_11 AC 121 ms
55,408 KB
testcase_12 AC 124 ms
56,056 KB
testcase_13 AC 124 ms
55,964 KB
testcase_14 AC 125 ms
56,292 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 124 ms
56,128 KB
testcase_19 AC 121 ms
55,668 KB
testcase_20 AC 122 ms
55,720 KB
testcase_21 WA -
testcase_22 AC 121 ms
55,688 KB
testcase_23 AC 122 ms
55,804 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 123 ms
54,164 KB
testcase_27 WA -
testcase_28 AC 123 ms
55,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Scanner;

public class No476 {

    public static void main(String[] args) {
	Scanner s = new Scanner(System.in);
	int N = s.nextInt();
	int A = s.nextInt();
	ArrayList<Integer> list = new ArrayList<>();
	for(int i=0;i<N;i++){
	    list.add(s.nextInt());
	}
	double ave; int sum = 0;
	for(int i :list){
	    sum += i;
	}
	ave = (double)sum / N;
	if(ave == A){
	    System.out.println("YES");
	}else{
	    System.out.println("NO");
	}
    }

}
0