結果

問題 No.67 よくある棒を切る問題 (1)
コンテスト
ユーザー tktk_snsn
提出日時 2021-02-24 22:24:06
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 360 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 361 ms
コンパイル使用メモリ 95,856 KB
実行使用メモリ 121,528 KB
最終ジャッジ日時 2026-07-06 18:42:20
合計ジャッジ時間 5,288 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

eps = 1e-10
N = int(input())
A = list(map(lambda x: float(x) + eps, input().split()))
K = int(input())


def OK(L):
    cnt = 0
    for a in A:
        cnt += int(a / L)
    return cnt >= K


wa = eps
ac = 1e20
while ac - wa > ac * eps:
    wj = (ac + wa) * 0.5
    if OK(wj):
        wa = wj
    else:
        ac = wj

print("{:.20f}".format((ac + wa) * 0.5))
0