Baekjoon #1654

Baekjoon #1654

1개의 풀이 · Python

문제 원문 보기 ↗

SOLUTION INFO

Python · main.py

main.py
import sys

def input():
    return sys.stdin.readline().rstrip()

def binary_search():
    global ans
    start, end = 1, max(arr)

    while start <= end:
        ct = 0
        mid = (start + end) // 2
        for i in arr:
            ct += i // mid
        if ct < N:
            end = mid - 1
        else:
            start = mid + 1
    ans = end

K,N = map(int, input().split())
arr = []
ans = 0
for i in range(K):
    arr.append(int(input()))
binary_search()
print(ans)

SOLUTION DESCRIPTION

풀이 설명

등록된 풀이 설명이 없습니다.