728x90
반응형
이분 탐색 문제이다.
M, N = map(int, input().split())
li = list(map(int, input().split()))
s, e = 1, max(li)
res = 0
while s <= e:
m = (s+e)//2
if sum([n//m for n in li]) >= M:
res = m
s = m+1
else:
e = m-1
print(res)
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 17245번 서버실(python) (0) | 2021.02.28 |
---|---|
백준 알고리즘 16564번 히오스 프로게이머(python) (0) | 2021.02.28 |
백준 알고리즘 19637번 IF문 좀 대신 써줘(python) (0) | 2021.02.28 |
백준 알고리즘 1166번 선물(python) (2) | 2021.02.28 |
백준 알고리즘 16561번 3의 배수(python) (0) | 2021.02.28 |