백준:2217 로프

computer_log·2023년 9월 29일
0

아직 파이썬이 어색하다

입력하는것 조차 어색하다니 ㅠㅠ

반복!!

n=int(input())
data=[]
for _ in range(n):
  x=int(input())
  data.append(x)
data.sort()
answer=[]
for i in range(0,n):
  sum=0
  sum=data[i]*(n-i)
  answer.append(int(sum))

print(max(answer))

->

profile
computer_log

0개의 댓글