📜  python代码示例中收集糖果codevita解决方案

📅  最后修改于: 2022-03-11 14:46:51.359000             🧑  作者: Mango

代码示例1
T =  int(input())
arr1 = []
for i in range(0, T):
    N = int(input())
    arr = list(map(int,input().split()))
    arr.sort()
    count = arr[0]
    for i in range(1, len(arr)):
        count = count + arr[i]
        arr1.append(count)
print(sum(arr1))