Skip to content

Commit 202bdec

Browse files
committed
[BOJ] #1654.랜선 자르기 / 실버2 / 20(O)
1 parent 6252071 commit 202bdec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

learntosurf/Binary Search/2025-01-14-[BOJ]-#1654-랜선자르기.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
def binary_search(start, end):
88
while start <= end:
99
mid = (start + end) // 2
10-
lines = 0
10+
lines = 0 # 랜선의 개수
1111
for i in lan:
1212
lines += i // mid
13-
if lines >= N:
13+
if lines >= N: # 랜선의 개수가 많음 (랜선의 길이가 짧음)
1414
start = mid + 1
15-
else:
15+
else: # 랜선의 개수가 적음 (랜선의 길이가 김)
1616
end = mid - 1
1717
return end
1818

0 commit comments

Comments
 (0)