https://programmers.co.kr/learn/courses/30/lessons/43238
def solution(n, times):
start=1
end=min(times)*n
answer=end
while(end>=start):
mid=(start+end)//2
people=0
for i in times:
people+=mid//i
if people>=n:
end=mid-1
if answer>=mid:
answer=mid
else:
start=mid+1
return answer
'Programming > Programmers' 카테고리의 다른 글
[프로그래머스] 디스크 컨트롤러(Python) (0) | 2021.08.12 |
---|---|
[프로그래머스] N으로 표현(Python) (0) | 2021.08.12 |
[프로그래머스] 도둑질(Python) (0) | 2021.08.12 |
[프로그래머스] 징검다리(Python) (0) | 2021.08.12 |
[프로그래머스] 다단계 칫솔 판매(Python) (0) | 2021.08.10 |
댓글