結果

問題 No.1823 Tricolor Dango
ユーザー 👑 tamatotamato
提出日時 2022-01-28 21:24:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,580 KB
実行使用メモリ 101,752 KB
最終ジャッジ日時 2023-08-28 19:04:17
合計ジャッジ時間 4,462 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,892 KB
testcase_01 AC 131 ms
78,676 KB
testcase_02 AC 125 ms
78,032 KB
testcase_03 AC 129 ms
77,976 KB
testcase_04 AC 105 ms
77,240 KB
testcase_05 AC 105 ms
77,416 KB
testcase_06 AC 108 ms
77,208 KB
testcase_07 AC 99 ms
76,812 KB
testcase_08 AC 96 ms
76,816 KB
testcase_09 AC 97 ms
76,688 KB
testcase_10 AC 97 ms
76,824 KB
testcase_11 AC 96 ms
76,644 KB
testcase_12 AC 94 ms
76,728 KB
testcase_13 AC 99 ms
77,824 KB
testcase_14 AC 98 ms
77,796 KB
testcase_15 AC 94 ms
77,784 KB
testcase_16 AC 87 ms
80,660 KB
testcase_17 AC 85 ms
80,216 KB
testcase_18 AC 103 ms
88,368 KB
testcase_19 AC 157 ms
101,752 KB
testcase_20 AC 101 ms
88,372 KB
testcase_21 AC 118 ms
77,916 KB
testcase_22 AC 127 ms
78,108 KB
testcase_23 AC 116 ms
77,820 KB
testcase_24 AC 117 ms
77,740 KB
testcase_25 AC 120 ms
77,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    for _ in range(int(input())):
        N = int(input())
        A = list(map(int, input().split()))

        A.sort()
        S = sum(A)
        if S % 3:
            print("No")
            continue
        a = A[-1]
        if a * 2 > S - a:
            print("No")
        else:
            print("Yes")


if __name__ == '__main__':
    main()
0