結果

問題 No.1823 Tricolor Dango
ユーザー titiatitia
提出日時 2022-01-28 21:24:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 29,972 KB
最終ジャッジ日時 2023-08-28 19:03:32
合計ジャッジ時間 3,068 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,856 KB
testcase_01 AC 70 ms
8,188 KB
testcase_02 AC 68 ms
8,144 KB
testcase_03 AC 70 ms
7,908 KB
testcase_04 AC 46 ms
8,232 KB
testcase_05 AC 46 ms
8,204 KB
testcase_06 AC 47 ms
8,372 KB
testcase_07 AC 44 ms
8,524 KB
testcase_08 AC 41 ms
8,584 KB
testcase_09 AC 46 ms
8,648 KB
testcase_10 AC 43 ms
8,516 KB
testcase_11 AC 40 ms
8,680 KB
testcase_12 AC 37 ms
8,584 KB
testcase_13 AC 43 ms
10,680 KB
testcase_14 AC 41 ms
10,704 KB
testcase_15 AC 41 ms
11,024 KB
testcase_16 AC 27 ms
12,556 KB
testcase_17 AC 35 ms
12,256 KB
testcase_18 AC 65 ms
17,748 KB
testcase_19 AC 133 ms
29,972 KB
testcase_20 AC 64 ms
17,724 KB
testcase_21 AC 55 ms
7,848 KB
testcase_22 AC 66 ms
8,324 KB
testcase_23 AC 48 ms
8,272 KB
testcase_24 AC 54 ms
8,280 KB
testcase_25 AC 68 ms
7,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

T=int(input())
for tests in range(T):    
    n=int(input())
    A=list(map(int,input().split()))

    if sum(A)%3!=0:
        print("No")
        continue

    A.sort()

    if A[-1]+A[-2]<=sum(A)//3*2 and A[-1]<=sum(A)//3:
        print("Yes")
    else:
        print("No")

    

0