백준

백준 11399번: ATM (파이썬)

inns21 2023. 7. 30. 00:20

n = int(input())
n_list = list(map(int, input().split()))
n_list.sort()

total = 0
for i in range(1,len(n_list)+1):
  total += sum(n_list[0:i])
print(total)