-Code
n = int(input())
steel_stick = sorted(list(map(int, input().split())))
total_len = sum(steel_stick)
cost = 0
for i in steel_stick:
total_len -= i
cost += total_len * i
print(cost)
'Beakjoon&프로그래머스 > 파이썬' 카테고리의 다른 글
[백준/파이썬] 1817번 짐 챙기는 숌 (0) | 2022.05.08 |
---|---|
[백준/파이썬] 11256번 사탕 (0) | 2022.05.08 |
[백준/파이썬] 19939번 박 터뜨리기 (0) | 2022.05.08 |
[백준/파이썬] 20922번 겹치는 건 싫어 (0) | 2022.05.07 |
[백준/파이썬] 11441번 합 구하기 (0) | 2022.05.07 |