結果

問題 No.476 正しくない平均
ユーザー gu_21816943gu_21816943
提出日時 2017-06-26 01:07:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 538 bytes
コンパイル時間 2,046 ms
コンパイル使用メモリ 74,636 KB
実行使用メモリ 54,544 KB
最終ジャッジ日時 2024-04-14 23:52:38
合計ジャッジ時間 6,806 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
53,992 KB
testcase_01 AC 127 ms
53,956 KB
testcase_02 AC 114 ms
52,996 KB
testcase_03 AC 126 ms
53,852 KB
testcase_04 AC 124 ms
53,876 KB
testcase_05 AC 127 ms
53,940 KB
testcase_06 AC 128 ms
54,092 KB
testcase_07 AC 127 ms
54,212 KB
testcase_08 AC 127 ms
54,004 KB
testcase_09 AC 130 ms
53,908 KB
testcase_10 AC 130 ms
54,176 KB
testcase_11 AC 127 ms
53,912 KB
testcase_12 AC 128 ms
54,180 KB
testcase_13 AC 130 ms
54,116 KB
testcase_14 AC 133 ms
54,312 KB
testcase_15 AC 129 ms
54,032 KB
testcase_16 AC 120 ms
53,076 KB
testcase_17 AC 131 ms
54,168 KB
testcase_18 AC 132 ms
54,196 KB
testcase_19 AC 132 ms
54,240 KB
testcase_20 AC 126 ms
54,184 KB
testcase_21 AC 128 ms
53,972 KB
testcase_22 AC 128 ms
54,164 KB
testcase_23 AC 128 ms
54,012 KB
testcase_24 AC 128 ms
54,016 KB
testcase_25 AC 130 ms
54,200 KB
testcase_26 AC 128 ms
54,132 KB
testcase_27 AC 128 ms
54,120 KB
testcase_28 AC 130 ms
54,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] str=sc.nextLine().split(" ");
		int[] num1=new int[2];
		num1[0]=Integer.parseInt(str[0]);
		num1[1]=Integer.parseInt(str[1]);
		str=sc.nextLine().split(" ");
		long[] num2=new long[num1[0]];
		sc.close();
		long sum=0;
		for(int i=0;i<num2.length;i++){
			sum+=Long.parseLong(str[i]);
		}
		if(num1[1]==(double)sum/num2.length){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}
0