結果

問題 No.476 正しくない平均
ユーザー Mcpu3Mcpu3
提出日時 2018-06-22 01:11:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 2,032 ms
コンパイル使用メモリ 72,784 KB
実行使用メモリ 56,052 KB
最終ジャッジ日時 2023-09-13 07:47:39
合計ジャッジ時間 6,636 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,880 KB
testcase_01 AC 122 ms
55,904 KB
testcase_02 AC 124 ms
55,988 KB
testcase_03 AC 122 ms
55,724 KB
testcase_04 AC 121 ms
55,968 KB
testcase_05 AC 122 ms
55,876 KB
testcase_06 AC 121 ms
55,876 KB
testcase_07 AC 120 ms
55,480 KB
testcase_08 AC 121 ms
55,732 KB
testcase_09 AC 122 ms
55,876 KB
testcase_10 AC 121 ms
55,800 KB
testcase_11 AC 122 ms
55,800 KB
testcase_12 AC 123 ms
55,776 KB
testcase_13 AC 123 ms
54,252 KB
testcase_14 AC 123 ms
55,920 KB
testcase_15 AC 126 ms
55,492 KB
testcase_16 AC 124 ms
55,772 KB
testcase_17 AC 123 ms
55,664 KB
testcase_18 AC 123 ms
55,772 KB
testcase_19 AC 132 ms
55,496 KB
testcase_20 AC 131 ms
55,896 KB
testcase_21 AC 124 ms
55,736 KB
testcase_22 AC 122 ms
55,484 KB
testcase_23 AC 128 ms
56,052 KB
testcase_24 AC 122 ms
55,816 KB
testcase_25 AC 122 ms
55,900 KB
testcase_26 AC 123 ms
55,896 KB
testcase_27 AC 123 ms
55,772 KB
testcase_28 AC 121 ms
55,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no476{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n,a,x,i;
		long s=0;
		n=stdIn.nextInt();
		a=stdIn.nextInt();
		for(i=0;i<n;i++) {
			x=stdIn.nextInt();
			s+=x;
		}
		if(s%n==0&&s/n==a) System.out.print("YES");
		else System.out.print("NO");
	}
}
0