結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー nisizawanisizawa
提出日時 2017-12-09 17:04:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,463 ms / 5,000 ms
コード長 374 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 33,516 KB
最終ジャッジ日時 2024-04-26 00:21:08
合計ジャッジ時間 43,622 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,215 ms
32,904 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 947 ms
19,016 KB
testcase_03 AC 1,762 ms
26,692 KB
testcase_04 AC 2,350 ms
29,340 KB
testcase_05 AC 2,330 ms
29,432 KB
testcase_06 AC 1,916 ms
29,336 KB
testcase_07 AC 2,449 ms
33,392 KB
testcase_08 AC 2,463 ms
33,516 KB
testcase_09 AC 1,970 ms
33,392 KB
testcase_10 AC 2,051 ms
26,548 KB
testcase_11 AC 2,266 ms
28,528 KB
testcase_12 AC 1,676 ms
26,652 KB
testcase_13 AC 2,307 ms
31,140 KB
testcase_14 AC 2,324 ms
32,316 KB
testcase_15 AC 1,682 ms
30,116 KB
testcase_16 AC 1,447 ms
29,340 KB
testcase_17 AC 1,282 ms
29,328 KB
testcase_18 AC 1,171 ms
29,336 KB
testcase_19 AC 1,149 ms
33,388 KB
testcase_20 AC 1,167 ms
33,508 KB
testcase_21 AC 1,141 ms
33,388 KB
testcase_22 AC 1,124 ms
27,648 KB
testcase_23 AC 1,143 ms
28,672 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 AC 83 ms
11,264 KB
testcase_26 AC 51 ms
11,008 KB
testcase_27 AC 44 ms
10,880 KB
testcase_28 AC 430 ms
14,332 KB
testcase_29 AC 244 ms
12,392 KB
testcase_30 AC 86 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ls = list(map(int, input().split()))
k = int(input())

low = 0
high = max(ls)
mid = (low + high) / 2
eps = 10**-9

while (high - low) > eps * 2 and (high - low) / mid > eps * 2:
    ct = 0
    for l in ls:
        ct += l // mid
        
    if ct >= k:
        low = mid
    else:
        high = mid
    mid = (low + high) / 2

print('{:.20f}'.format(mid))
0