結果

問題 No.1823 Tricolor Dango
ユーザー titan23titan23
提出日時 2022-06-29 02:37:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 102,144 KB
最終ジャッジ日時 2024-05-01 16:37:01
合計ジャッジ時間 4,187 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,712 KB
testcase_01 AC 99 ms
76,672 KB
testcase_02 AC 95 ms
76,288 KB
testcase_03 AC 99 ms
76,416 KB
testcase_04 AC 76 ms
75,648 KB
testcase_05 AC 76 ms
75,648 KB
testcase_06 AC 74 ms
75,520 KB
testcase_07 AC 65 ms
75,392 KB
testcase_08 AC 66 ms
75,136 KB
testcase_09 AC 67 ms
75,776 KB
testcase_10 AC 66 ms
75,136 KB
testcase_11 AC 68 ms
75,136 KB
testcase_12 AC 64 ms
75,392 KB
testcase_13 AC 65 ms
76,288 KB
testcase_14 AC 64 ms
75,904 KB
testcase_15 AC 63 ms
75,776 KB
testcase_16 AC 51 ms
66,688 KB
testcase_17 AC 55 ms
67,200 KB
testcase_18 AC 64 ms
77,440 KB
testcase_19 AC 102 ms
102,144 KB
testcase_20 AC 61 ms
78,208 KB
testcase_21 AC 88 ms
76,672 KB
testcase_22 AC 98 ms
76,288 KB
testcase_23 AC 86 ms
76,416 KB
testcase_24 AC 90 ms
76,800 KB
testcase_25 AC 94 ms
76,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()

#  -----------------------  #

def main():
  n = int(input())
  A = list(map(int, input().split()))
  sm = sum(A)
  if sm % 3:
    return 'No'
  k = sm // 3
  for a in A:
    if a > k:
      return 'No'
  return 'Yes'


print('\n'.join(str(main()) for _ in range(int(input()))))
0