Skip to content

Commit 4f6993c

Browse files
committed
[BOJ] 2217 로프 (S4)
1 parent ddfcaa6 commit 4f6993c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

김지호/3주차/260114.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# https://www.acmicpc.net/problem/2217
2+
3+
import sys
4+
from collections import defaultdict
5+
from collections import deque
6+
7+
sys.stdin = open("../input.txt",'r')
8+
9+
N = int(input())
10+
numbers = []
11+
for _ in range(N):
12+
numbers.append(int(input()))
13+
14+
numbers.sort(reverse=True)
15+
16+
max_weight = 0
17+
for i in range(N):
18+
max_weight = max(max_weight, numbers[i] * (i + 1))
19+
20+
print(max_weight)

0 commit comments

Comments
 (0)