結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー rpy3cpprpy3cpp
提出日時 2015-07-21 23:21:08
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 495 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 107,756 KB
最終ジャッジ日時 2023-09-22 21:03:57
合計ジャッジ時間 9,793 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
99,508 KB
testcase_01 AC 78 ms
76,504 KB
testcase_02 AC 146 ms
88,352 KB
testcase_03 AC 206 ms
99,412 KB
testcase_04 AC 244 ms
107,720 KB
testcase_05 AC 242 ms
107,740 KB
testcase_06 AC 265 ms
107,756 KB
testcase_07 AC 265 ms
100,932 KB
testcase_08 AC 260 ms
100,644 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import floor, sqrt
def read_data():
    N = int(input())
    Ls = list(map(int, input().split()))
    K = int(input())
    return N, Ls, K

def solve(N, Ls, K):
    eps = 10**-10
    lower = max(Ls)/K - eps
    upper = max(Ls) + eps
    while upper - lower > eps:
        mid = sqrt(upper * lower)
        if sum(floor(L/mid) for L in Ls) >= K:
            lower = mid
        else:
            upper = mid
    return (upper + lower) / 2

N, Ls, K = read_data()
print(solve(N, Ls, K))
0