(진행중) [백준] 로프

데린이·2022년 5월 24일
0

https://www.acmicpc.net/problem/2217

22-05-24

N = int(input())
ropes = sorted([int(input()) for _ in range(N)],reverse = True)

answer = 0
while(ropes):
    answer = max(answer,ropes[-1]*len(ropes))
    ropes.pop()
    
print(answer)

Time cost가 있음 왜일까~
max = O(n)이기 때문에 루프안에서 max 사용하는 것이 좋지 않음

profile
취뽀를 기원하는 취준생입니다!

0개의 댓글