結果

問題 No.1823 Tricolor Dango
ユーザー gr1msl3ygr1msl3y
提出日時 2022-01-28 21:45:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 1,538 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 100,576 KB
最終ジャッジ日時 2023-08-28 19:37:05
合計ジャッジ時間 4,636 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,380 KB
testcase_01 AC 151 ms
78,052 KB
testcase_02 AC 156 ms
77,792 KB
testcase_03 AC 155 ms
78,000 KB
testcase_04 AC 114 ms
77,528 KB
testcase_05 AC 115 ms
77,472 KB
testcase_06 AC 115 ms
77,464 KB
testcase_07 AC 90 ms
76,620 KB
testcase_08 AC 88 ms
76,836 KB
testcase_09 AC 92 ms
76,728 KB
testcase_10 AC 88 ms
76,856 KB
testcase_11 AC 90 ms
76,824 KB
testcase_12 AC 90 ms
76,804 KB
testcase_13 AC 88 ms
77,668 KB
testcase_14 AC 87 ms
77,696 KB
testcase_15 AC 86 ms
77,988 KB
testcase_16 AC 82 ms
80,440 KB
testcase_17 AC 81 ms
80,512 KB
testcase_18 AC 92 ms
88,320 KB
testcase_19 AC 123 ms
100,576 KB
testcase_20 AC 93 ms
88,468 KB
testcase_21 AC 143 ms
78,376 KB
testcase_22 AC 154 ms
77,780 KB
testcase_23 AC 136 ms
77,936 KB
testcase_24 AC 143 ms
78,912 KB
testcase_25 AC 155 ms
78,648 KB
権限があれば一括ダウンロードができます

ソースコード

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