結果

問題 No.476 正しくない平均
ユーザー yuiyui
提出日時 2017-02-20 10:27:31
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 4,878 ms
コンパイル使用メモリ 71,428 KB
実行使用メモリ 57,536 KB
最終ジャッジ日時 2023-08-28 19:36:03
合計ジャッジ時間 10,059 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,724 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 125 ms
55,760 KB
testcase_04 AC 125 ms
55,956 KB
testcase_05 WA -
testcase_06 AC 126 ms
55,632 KB
testcase_07 AC 125 ms
55,792 KB
testcase_08 AC 126 ms
55,876 KB
testcase_09 AC 124 ms
55,852 KB
testcase_10 AC 125 ms
55,832 KB
testcase_11 WA -
testcase_12 AC 127 ms
55,712 KB
testcase_13 AC 127 ms
57,524 KB
testcase_14 AC 127 ms
55,380 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 125 ms
55,856 KB
testcase_19 AC 126 ms
55,640 KB
testcase_20 AC 127 ms
55,868 KB
testcase_21 WA -
testcase_22 AC 128 ms
55,636 KB
testcase_23 AC 125 ms
55,680 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 128 ms
55,388 KB
testcase_27 WA -
testcase_28 AC 128 ms
53,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

    	Scanner sc = new Scanner(System.in);
    	int num = sc.nextInt();
    	int av = sc.nextInt();
    	int ar[] = new int[num];
    	int ans = 0;
    	for(int i=0;i<num;i++){
    		ans += sc.nextInt();
    	}
    	int ret = ans/num;

    	if(ret==av){
    		System.out.println("YES");
    	}else{
    		System.out.println("NO");
    	}
    }

}
0