Baekjoon #3079

Baekjoon #3079

1개의 풀이 · Python

문제 원문 보기 ↗

SOLUTION INFO

Python · main.py

main.py
import sys

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

n, m = map(int, input().split())
arr = [int(input()) for _ in range(n)]
    
low, high = 0, 1000000000 * m
while low <= high:
    mid = (low + high)//2
    cnt = 0
    for time in arr:
        cnt += mid//time
    if cnt>=m:
        high = mid - 1
    else:
        low = mid + 1

print(low)

SOLUTION DESCRIPTION

풀이 설명

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