[๋ฐฑ์ค 11399] [greedy] ATM ๋ฐฑ์ค 11399๋ฒ [ATM] ํ์ด) n = int(input()) lst = sorted(list(map(int,input().split(' ')))) cnt = 0 for i in range(n,0,-1) : cnt += i*lst[len(lst)-i] print(cnt) ๋ฐฑ์ค & ํ๋ก๊ทธ๋๋จธ์ค/greedy 2021.04.17