結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー dice4084dice4084
提出日時 2023-01-03 15:51:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 299 ms / 5,000 ms
コード長 485 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 110,436 KB
最終ジャッジ日時 2023-08-18 00:23:16
合計ジャッジ時間 9,638 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 299 ms
101,684 KB
testcase_01 AC 77 ms
76,072 KB
testcase_02 AC 160 ms
87,696 KB
testcase_03 AC 237 ms
103,212 KB
testcase_04 AC 294 ms
105,956 KB
testcase_05 AC 294 ms
105,872 KB
testcase_06 AC 293 ms
105,976 KB
testcase_07 AC 294 ms
101,816 KB
testcase_08 AC 294 ms
102,132 KB
testcase_09 AC 290 ms
101,848 KB
testcase_10 AC 281 ms
110,436 KB
testcase_11 AC 289 ms
108,956 KB
testcase_12 AC 265 ms
105,996 KB
testcase_13 AC 278 ms
99,276 KB
testcase_14 AC 287 ms
101,568 KB
testcase_15 AC 262 ms
98,892 KB
testcase_16 AC 292 ms
105,920 KB
testcase_17 AC 292 ms
105,932 KB
testcase_18 AC 291 ms
105,972 KB
testcase_19 AC 291 ms
101,796 KB
testcase_20 AC 297 ms
102,044 KB
testcase_21 AC 293 ms
102,032 KB
testcase_22 AC 281 ms
110,372 KB
testcase_23 AC 282 ms
107,976 KB
testcase_24 AC 72 ms
71,480 KB
testcase_25 AC 88 ms
76,844 KB
testcase_26 AC 86 ms
76,816 KB
testcase_27 AC 81 ms
76,364 KB
testcase_28 AC 115 ms
80,076 KB
testcase_29 AC 99 ms
77,024 KB
testcase_30 AC 89 ms
76,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline


def get_num_tree(length):
    ans = sum(int(tree / length) for tree in L)
    return ans


n = int(input())
L = tuple(map(int, input().split()))
k = int(input())

l = 0
r = max(L) + 1
# while r - l >= 10 ** (-9):
#     mid = (l + r) / 2
#     if get_num_tree(mid) >= k:
#         l = mid
#     else:
#         r = mid
for _ in range(100):
    mid = (l + r) / 2
    if get_num_tree(mid) >= k:
        l = mid
    else:
        r = mid

print(l)
0