結果

問題 No.1823 Tricolor Dango
ユーザー AsahiAsahi
提出日時 2023-02-05 06:32:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 780 ms / 2,000 ms
コード長 888 bytes
コンパイル時間 3,140 ms
コンパイル使用メモリ 71,780 KB
実行使用メモリ 66,740 KB
最終ジャッジ日時 2023-09-17 00:56:40
合計ジャッジ時間 18,626 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,552 KB
testcase_01 AC 601 ms
61,428 KB
testcase_02 AC 574 ms
60,920 KB
testcase_03 AC 604 ms
62,608 KB
testcase_04 AC 521 ms
60,832 KB
testcase_05 AC 513 ms
60,560 KB
testcase_06 AC 528 ms
60,628 KB
testcase_07 AC 548 ms
60,360 KB
testcase_08 AC 532 ms
60,716 KB
testcase_09 AC 550 ms
60,084 KB
testcase_10 AC 575 ms
60,640 KB
testcase_11 AC 520 ms
60,944 KB
testcase_12 AC 491 ms
60,480 KB
testcase_13 AC 531 ms
60,612 KB
testcase_14 AC 533 ms
60,336 KB
testcase_15 AC 521 ms
60,016 KB
testcase_16 AC 361 ms
60,484 KB
testcase_17 AC 412 ms
60,916 KB
testcase_18 AC 514 ms
60,404 KB
testcase_19 AC 780 ms
66,740 KB
testcase_20 AC 516 ms
60,664 KB
testcase_21 AC 542 ms
60,540 KB
testcase_22 AC 600 ms
61,428 KB
testcase_23 AC 553 ms
60,996 KB
testcase_24 AC 574 ms
60,568 KB
testcase_25 AC 594 ms
61,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
// import java.math.*;
// import java.util.stream.Stream;

class Main{
    static BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter output = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    
    public static void main(String[] args) throws IOException{
        int T = sc.nextInt();
        while(T-->0) {
            int n = sc.nextInt();
            long [] A = new long[n];
            long sum = 0;
            long max = -1;
            for(int i=0;i<n;i++) {
                A[i] = sc.nextLong();
                sum += A[i];
                max = Math.max(max,A[i]);
            }
            if(sum % 3 == 0 && max <= sum/3) output.println("Yes");
            else output.println("No");
        }
        output.flush();
    }
}
0