結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー titiatitia
提出日時 2021-12-26 02:17:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 760 ms / 5,000 ms
コード長 333 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 82,796 KB
実行使用メモリ 105,820 KB
最終ジャッジ日時 2024-04-26 01:27:33
合計ジャッジ時間 13,359 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 355 ms
100,220 KB
testcase_01 AC 40 ms
52,852 KB
testcase_02 AC 317 ms
86,492 KB
testcase_03 AC 553 ms
97,224 KB
testcase_04 AC 554 ms
105,424 KB
testcase_05 AC 553 ms
105,364 KB
testcase_06 AC 453 ms
105,524 KB
testcase_07 AC 760 ms
100,364 KB
testcase_08 AC 755 ms
100,468 KB
testcase_09 AC 596 ms
100,556 KB
testcase_10 AC 506 ms
102,184 KB
testcase_11 AC 531 ms
105,136 KB
testcase_12 AC 392 ms
102,000 KB
testcase_13 AC 691 ms
103,548 KB
testcase_14 AC 721 ms
105,820 KB
testcase_15 AC 523 ms
102,760 KB
testcase_16 AC 297 ms
105,416 KB
testcase_17 AC 270 ms
105,432 KB
testcase_18 AC 285 ms
105,476 KB
testcase_19 AC 280 ms
100,480 KB
testcase_20 AC 323 ms
100,592 KB
testcase_21 AC 287 ms
100,344 KB
testcase_22 AC 299 ms
102,056 KB
testcase_23 AC 253 ms
105,164 KB
testcase_24 AC 40 ms
53,572 KB
testcase_25 AC 68 ms
65,404 KB
testcase_26 AC 53 ms
62,848 KB
testcase_27 AC 52 ms
61,152 KB
testcase_28 AC 175 ms
79,472 KB
testcase_29 AC 114 ms
75,440 KB
testcase_30 AC 68 ms
65,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
L=list(map(int,input().split()))
K=int(input())

OK=max(L)/K
NG=sum(L)/K

while NG-OK>=max(10**(-9),OK/(10**9)):
    mid=(OK+NG)/2

    ST=0
    for l in L:
        ST+=l//mid

        if ST>=K:
            break

    if ST>=K:
        OK=mid
    else:
        NG=mid

print(OK)
0