結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー lloyzlloyz
提出日時 2022-01-16 16:42:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 5,000 ms
コード長 374 bytes
コンパイル時間 719 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 105,968 KB
最終ジャッジ日時 2024-04-26 01:26:05
合計ジャッジ時間 5,375 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 169 ms
100,424 KB
testcase_01 AC 39 ms
52,740 KB
testcase_02 AC 81 ms
80,784 KB
testcase_03 AC 107 ms
95,272 KB
testcase_04 AC 133 ms
103,792 KB
testcase_05 AC 133 ms
103,552 KB
testcase_06 AC 133 ms
103,876 KB
testcase_07 AC 143 ms
99,948 KB
testcase_08 AC 141 ms
100,424 KB
testcase_09 AC 143 ms
100,268 KB
testcase_10 AC 123 ms
99,140 KB
testcase_11 AC 128 ms
102,948 KB
testcase_12 AC 120 ms
99,556 KB
testcase_13 AC 128 ms
102,156 KB
testcase_14 AC 134 ms
105,968 KB
testcase_15 AC 123 ms
102,912 KB
testcase_16 AC 135 ms
103,616 KB
testcase_17 AC 136 ms
103,468 KB
testcase_18 AC 153 ms
105,552 KB
testcase_19 AC 151 ms
100,328 KB
testcase_20 AC 168 ms
100,464 KB
testcase_21 AC 165 ms
100,188 KB
testcase_22 AC 139 ms
99,164 KB
testcase_23 AC 144 ms
103,808 KB
testcase_24 AC 36 ms
53,388 KB
testcase_25 AC 49 ms
63,112 KB
testcase_26 AC 47 ms
61,896 KB
testcase_27 AC 43 ms
60,552 KB
testcase_28 AC 59 ms
69,456 KB
testcase_29 AC 51 ms
66,552 KB
testcase_30 AC 48 ms
62,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

n = int(input())
L = list(map(int, input().split()))
k = int(input())
eps = 1e-9

left = max(L) / k
right = sum(L) / k
while right - left > max(eps, left * eps):
    mid = (left + right) / 2
    cnt = 0
    for i in range(n):
        cnt += int(L[i] / mid)
    if cnt >= k:
        left = mid
    else:
        right = mid
print(left)
0