結果

問題 No.1586 Equal Array
ユーザー merlinmerlin
提出日時 2021-07-08 22:24:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 217 ms / 1,000 ms
コード長 577 bytes
コンパイル時間 2,028 ms
コンパイル使用メモリ 72,364 KB
実行使用メモリ 61,564 KB
最終ジャッジ日時 2023-09-14 05:02:08
合計ジャッジ時間 6,431 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,388 KB
testcase_01 AC 43 ms
49,264 KB
testcase_02 AC 44 ms
49,308 KB
testcase_03 AC 43 ms
49,536 KB
testcase_04 AC 168 ms
60,316 KB
testcase_05 AC 166 ms
60,812 KB
testcase_06 AC 204 ms
60,008 KB
testcase_07 AC 211 ms
60,832 KB
testcase_08 AC 209 ms
61,564 KB
testcase_09 AC 217 ms
60,300 KB
testcase_10 AC 201 ms
60,512 KB
testcase_11 AC 41 ms
49,464 KB
testcase_12 AC 41 ms
49,480 KB
testcase_13 AC 200 ms
59,336 KB
testcase_14 AC 205 ms
59,528 KB
testcase_15 AC 208 ms
60,048 KB
testcase_16 AC 211 ms
60,756 KB
testcase_17 AC 42 ms
49,376 KB
testcase_18 AC 211 ms
61,100 KB
testcase_19 AC 214 ms
60,268 KB
testcase_20 AC 41 ms
49,520 KB
testcase_21 AC 42 ms
49,352 KB
testcase_22 AC 42 ms
49,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        int a,i; long sum=0;
        String s[]=bu.readLine().split(" ");
        for(i=0;i<n;i++)
        {
            a=Integer.parseInt(s[i]);
            sum+=a;
        }
        if(sum%n==0) sb.append("Yes\n");
        else sb.append("No\n");
        System.out.print(sb);
    }
}
0