We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddfcaa6 commit 4f6993cCopy full SHA for 4f6993c
1 file changed
김지호/3주차/260114.py
@@ -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