結果

問題 No.1823 Tricolor Dango
ユーザー gr1msl3y
提出日時 2022-01-28 21:45:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 161 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 82,260 KB
実行使用メモリ 101,888 KB
最終ジャッジ日時 2024-12-30 06:00:23
合計ジャッジ時間 4,289 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    T = int(input())
    ans = [None]*T
    for i in range(T):
        N = int(input())
        A = list(map(int, input().split()))
        ans[i] = 'Yes' if solve(N, A) else 'No'
    print(*ans, sep='\n')


def solve(N, A):
    S = sum(A)
    if S % 3:
        return False
    for a in A:
        if a > S//3:
            return False
    else:
        return True


main()
0