結果

問題 No.1823 Tricolor Dango
ユーザー shinichishinichi
提出日時 2022-01-28 21:28:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 86,796 KB
実行使用メモリ 100,324 KB
最終ジャッジ日時 2023-08-28 19:09:06
合計ジャッジ時間 4,579 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,380 KB
testcase_01 AC 242 ms
79,488 KB
testcase_02 AC 158 ms
79,364 KB
testcase_03 AC 236 ms
79,772 KB
testcase_04 AC 119 ms
78,264 KB
testcase_05 AC 117 ms
78,332 KB
testcase_06 AC 115 ms
78,312 KB
testcase_07 AC 85 ms
76,680 KB
testcase_08 AC 86 ms
76,664 KB
testcase_09 AC 87 ms
76,972 KB
testcase_10 AC 87 ms
76,716 KB
testcase_11 AC 84 ms
76,840 KB
testcase_12 AC 85 ms
76,912 KB
testcase_13 AC 83 ms
77,668 KB
testcase_14 AC 83 ms
77,636 KB
testcase_15 AC 82 ms
77,768 KB
testcase_16 AC 75 ms
80,272 KB
testcase_17 AC 79 ms
80,680 KB
testcase_18 AC 87 ms
88,552 KB
testcase_19 AC 117 ms
100,324 KB
testcase_20 AC 88 ms
88,512 KB
testcase_21 AC 174 ms
78,144 KB
testcase_22 AC 154 ms
78,748 KB
testcase_23 AC 141 ms
79,932 KB
testcase_24 AC 135 ms
78,880 KB
testcase_25 AC 217 ms
78,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    N = int(input())
    A = list(map(int, input().split()))
    can = True
    sumA = sum(A)
    if sumA % 3 != 0:
        can = False
    else:
        sticks = sumA // 3
        for a in A:
            if sticks < a:
                can = False
                break
    if can:
        print("Yes")
    else:
        print("No")
0