結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー flippergoflippergo
提出日時 2020-12-21 14:44:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 862 ms / 5,000 ms
コード長 311 bytes
コンパイル時間 335 ms
コンパイル使用メモリ 82,548 KB
実行使用メモリ 107,344 KB
最終ジャッジ日時 2024-04-26 01:13:03
合計ジャッジ時間 14,703 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 438 ms
102,336 KB
testcase_01 AC 41 ms
58,760 KB
testcase_02 AC 351 ms
87,156 KB
testcase_03 AC 626 ms
98,176 KB
testcase_04 AC 623 ms
106,512 KB
testcase_05 AC 618 ms
106,464 KB
testcase_06 AC 502 ms
106,648 KB
testcase_07 AC 856 ms
102,056 KB
testcase_08 AC 862 ms
101,992 KB
testcase_09 AC 691 ms
102,212 KB
testcase_10 AC 564 ms
102,908 KB
testcase_11 AC 586 ms
106,292 KB
testcase_12 AC 441 ms
102,592 KB
testcase_13 AC 792 ms
104,912 KB
testcase_14 AC 806 ms
107,344 KB
testcase_15 AC 586 ms
104,332 KB
testcase_16 AC 303 ms
106,632 KB
testcase_17 AC 281 ms
106,452 KB
testcase_18 AC 322 ms
106,276 KB
testcase_19 AC 296 ms
102,200 KB
testcase_20 AC 351 ms
101,904 KB
testcase_21 AC 353 ms
102,200 KB
testcase_22 AC 308 ms
103,352 KB
testcase_23 AC 310 ms
106,096 KB
testcase_24 AC 37 ms
53,024 KB
testcase_25 AC 68 ms
65,520 KB
testcase_26 AC 56 ms
63,544 KB
testcase_27 AC 51 ms
61,144 KB
testcase_28 AC 191 ms
79,676 KB
testcase_29 AC 123 ms
75,208 KB
testcase_30 AC 68 ms
66,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = list(map(int,input().split()))
K = int(input())
eps = 1e-10
high = sum(L)/K+5
low = eps
while (high-low>eps) and (high-low)/high>eps:
    mid = (high+low)/2
    cnt = 0
    for i in range(N):
        cnt += L[i]//mid
    if cnt>=K:
        low = mid
    else:
        high = mid
print(high)
0