[Python] 백준 #2217- 로프
·
코딩테스트/백준[Python]
문제 2217번: 로프 N(1 ≤ N ≤ 100,000)개의 로프가 있다. 이 로프를 이용하여 이런 저런 물체를 들어올릴 수 있다. 각각의 로프는 그 굵기나 길이가 다르기 때문에 들 수 있는 물체의 중량이 서로 다를 수도 있다. 하 www.acmicpc.net 코드 My answer import sys input = sys.stdin.readline rope=[] n=int(input()) for i in range(n): rope.append(int(input())) rope.sort(reverse=True) answer=[(i[0]+1)*i[1] for i in enumerate(rope)] print(max(answer)) Another answer n=int(input()) maximum=sort..