結果

問題 No.1823 Tricolor Dango
コンテスト
ユーザー Ain48803949
提出日時 2022-01-28 21:58:04
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 62 ms / 2,000 ms
+ 639µs
コード長 1,057 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 57 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 33,664 KB
最終ジャッジ日時 2026-10-09 14:14:29
合計ジャッジ時間 3,662 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import bisect,collections,copy,heapq,itertools,math,string,sys,queue,time,random
input = lambda: sys.stdin.readline().rstrip()
def I(): return input()
def IS(): return input().split()
def II(): return int(input())
def IIS(): return list(map(int,input().split()))
def LIIS(): return list(map(int,input().split()))
def comb(n, r):return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
ragen=range
INF=10**18
MOD=998244353
#sys.setrecursionlimit(10**7)
alpha="abcdefghijklmnopqrstuvwxyz"
def bit(x):
    return bin(x).count("1")
##############################################################################
t=II()
for i in range(t):
    n=II()
    A=LIIS()
    if sum(A)%3==0 and max(A)<=sum(A)//3:
        print("Yes")
    else:
        print("No")
0