總網頁瀏覽量

2022年11月10日 星期四

2022年11月8日 星期二

A. 髮廊服務優化問題(barbershop) (2022.11.8二)

 


















Python Code:
n=int(input())
x=[int(_) for _ in input().split()] 
a=sorted(x)
b=[]
for i in range(len(a)):
    s=0
    for j in range(i+1):
        s+=a[j]
    b.append(s)
print(sum(b))