[BOJ] 2217: 로프

HJW·2022년 8월 25일
0
import sys
input = sys.stdin.readline

# 로프의 개수
n = int(input())

weight = []

for i in range(n):
    weight.append(int(input()))

weight.sort(reverse=True)

result = []

for k in range(1, n+1):
    result.append(weight[k-1]*k)

print(max(result))
​
profile
be passionate

0개의 댓글