結果

問題 No.476 正しくない平均
ユーザー swdamdrswdamdr
提出日時 2017-01-31 11:01:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 3,546 ms
コンパイル使用メモリ 72,536 KB
実行使用メモリ 56,532 KB
最終ジャッジ日時 2023-08-25 13:55:30
合計ジャッジ時間 9,940 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
56,116 KB
testcase_01 AC 136 ms
56,060 KB
testcase_02 AC 138 ms
55,880 KB
testcase_03 AC 137 ms
55,884 KB
testcase_04 AC 136 ms
55,832 KB
testcase_05 AC 136 ms
55,928 KB
testcase_06 AC 137 ms
56,100 KB
testcase_07 AC 136 ms
56,292 KB
testcase_08 AC 135 ms
56,108 KB
testcase_09 AC 136 ms
55,812 KB
testcase_10 AC 135 ms
56,112 KB
testcase_11 AC 135 ms
55,580 KB
testcase_12 AC 138 ms
55,436 KB
testcase_13 AC 137 ms
55,652 KB
testcase_14 AC 136 ms
54,112 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 134 ms
56,352 KB
testcase_19 AC 134 ms
56,096 KB
testcase_20 AC 135 ms
55,652 KB
testcase_21 WA -
testcase_22 AC 141 ms
55,976 KB
testcase_23 AC 142 ms
55,880 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 138 ms
55,828 KB
testcase_27 WA -
testcase_28 AC 134 ms
56,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Sample01 {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt();
		double a = scan.nextDouble();
		
		int[] arr = new int[n];
		
		for(int i=0;i<n;i++){
			arr[i] = scan.nextInt();			
		}
		
		int m = 0;
		
		for(int i=0;i<n;i++){
			m += arr[i];
		}
		
		if(a == (double)m/n){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}
0