Skip to content

Commit 73c3d3f

Browse files
committed
[BOJ] 랜선 자르기 / 실버 2 / 50분
https://www.acmicpc.net/problem/1654
1 parent d5d3e3f commit 73c3d3f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
N, K = map(int, input().split())
2+
lis = []
3+
for _ in range(N):
4+
lis.append(int(input()))
5+
6+
s = 1
7+
e = max(lis)
8+
9+
while s <= e:
10+
mid = (s + e) // 2
11+
LAN = 0
12+
for i in lis:
13+
LAN += i // mid
14+
if LAN >= K:
15+
s = mid + 1
16+
else:
17+
e = mid - 1
18+
19+
print(e)

0 commit comments

Comments
 (0)