結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー yuushi narazaki
提出日時 2025-03-07 13:30:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,211 ms / 5,000 ms
コード長 441 bytes
コンパイル時間 464 ms
コンパイル使用メモリ 82,848 KB
実行使用メモリ 107,864 KB
最終ジャッジ日時 2025-03-07 13:30:59
合計ジャッジ時間 18,949 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = list(map(int,input().split()))
K = int(input())

left = 0
right = 10**10 + 1

ans = 0

def search(mid,K,L):
    count = 0
    for i in range(N):
        if(L[i] >= mid):
            count += L[i] // mid
    
    if(count >= K):
        return True        


for i in range(100):
    mid = (left + right) / 2
    if(search(mid,K,L)):
        left = mid
        ans = max(ans,mid)
    else:
        right = mid

print(ans)
0