結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー tktk_snsntktk_snsn
提出日時 2021-02-24 22:24:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 197 ms / 5,000 ms
コード長 360 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 82,596 KB
実行使用メモリ 104,808 KB
最終ジャッジ日時 2024-04-26 01:17:47
合計ジャッジ時間 6,701 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 181 ms
100,296 KB
testcase_01 AC 41 ms
58,968 KB
testcase_02 AC 97 ms
82,308 KB
testcase_03 AC 160 ms
100,300 KB
testcase_04 AC 197 ms
104,488 KB
testcase_05 AC 197 ms
104,448 KB
testcase_06 AC 189 ms
104,300 KB
testcase_07 AC 197 ms
102,468 KB
testcase_08 AC 192 ms
102,580 KB
testcase_09 AC 187 ms
102,524 KB
testcase_10 AC 181 ms
103,652 KB
testcase_11 AC 190 ms
104,796 KB
testcase_12 AC 174 ms
104,152 KB
testcase_13 AC 182 ms
99,652 KB
testcase_14 AC 186 ms
101,756 KB
testcase_15 AC 170 ms
100,416 KB
testcase_16 AC 179 ms
103,804 KB
testcase_17 AC 179 ms
103,564 KB
testcase_18 AC 176 ms
103,872 KB
testcase_19 AC 178 ms
102,532 KB
testcase_20 AC 174 ms
102,572 KB
testcase_21 AC 175 ms
102,520 KB
testcase_22 AC 162 ms
103,648 KB
testcase_23 AC 170 ms
104,808 KB
testcase_24 AC 39 ms
52,208 KB
testcase_25 AC 48 ms
62,320 KB
testcase_26 AC 46 ms
61,932 KB
testcase_27 AC 42 ms
60,232 KB
testcase_28 AC 67 ms
69,804 KB
testcase_29 AC 56 ms
65,804 KB
testcase_30 AC 47 ms
61,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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