結果

問題 No.1823 Tricolor Dango
ユーザー puznekopuzneko
提出日時 2022-02-11 23:42:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 115,748 KB
最終ジャッジ日時 2023-09-10 06:43:21
合計ジャッジ時間 6,454 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,308 KB
testcase_01 AC 131 ms
99,072 KB
testcase_02 AC 131 ms
99,076 KB
testcase_03 AC 134 ms
99,100 KB
testcase_04 AC 117 ms
93,804 KB
testcase_05 AC 120 ms
93,796 KB
testcase_06 AC 119 ms
94,552 KB
testcase_07 AC 105 ms
93,320 KB
testcase_08 AC 101 ms
91,100 KB
testcase_09 AC 106 ms
95,208 KB
testcase_10 AC 107 ms
95,384 KB
testcase_11 AC 105 ms
93,640 KB
testcase_12 AC 103 ms
91,196 KB
testcase_13 AC 107 ms
95,836 KB
testcase_14 AC 104 ms
93,692 KB
testcase_15 AC 102 ms
91,536 KB
testcase_16 AC 85 ms
83,780 KB
testcase_17 AC 85 ms
83,796 KB
testcase_18 AC 99 ms
96,852 KB
testcase_19 AC 130 ms
115,748 KB
testcase_20 AC 101 ms
96,796 KB
testcase_21 AC 124 ms
96,320 KB
testcase_22 AC 134 ms
98,836 KB
testcase_23 AC 123 ms
96,088 KB
testcase_24 AC 122 ms
96,392 KB
testcase_25 AC 130 ms
98,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
t, *indata = map(int, stdin.read().split())
offset = 0
for _ in range(t):
    n = indata[offset]
    a = []
    for i in range(n):
        a.append(indata[offset+i+1])
    offset += n + 1
    val = sum(a)
    if val % 3 != 0:
        print("No")
    else:
        val = val // 3
        check = True
        for i in range(n):
            if a[i] > val:
                check = False
        if check:
            print("Yes")
        else:
            print("No")
0