얼렁뚱땅 백준 문제풀이
[백준 문제풀이] 얼렁뚱땅 11399번 ATM 문제 풀이
MOSTAR
2022. 2. 16. 11:38
Python을 이용한 문제풀이
풀이
n = int(input())
people = list(map(int, input().split()))
people.sort()
sum = 0
for i in range(len(people)) :
sum = sum + people[i]*(len(people)-i)
print(sum)