結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー lloyzlloyz
提出日時 2022-01-16 16:43:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 250 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 550 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 105,964 KB
最終ジャッジ日時 2024-04-26 01:27:18
合計ジャッジ時間 8,096 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 247 ms
100,272 KB
testcase_01 AC 42 ms
59,668 KB
testcase_02 AC 117 ms
79,520 KB
testcase_03 AC 179 ms
95,344 KB
testcase_04 AC 236 ms
104,004 KB
testcase_05 AC 236 ms
103,888 KB
testcase_06 AC 235 ms
103,744 KB
testcase_07 AC 246 ms
100,056 KB
testcase_08 AC 244 ms
100,420 KB
testcase_09 AC 239 ms
100,108 KB
testcase_10 AC 217 ms
99,304 KB
testcase_11 AC 225 ms
103,364 KB
testcase_12 AC 208 ms
99,120 KB
testcase_13 AC 222 ms
102,432 KB
testcase_14 AC 230 ms
105,964 KB
testcase_15 AC 212 ms
102,592 KB
testcase_16 AC 232 ms
104,052 KB
testcase_17 AC 234 ms
103,896 KB
testcase_18 AC 241 ms
105,548 KB
testcase_19 AC 242 ms
100,028 KB
testcase_20 AC 247 ms
100,436 KB
testcase_21 AC 250 ms
100,364 KB
testcase_22 AC 210 ms
99,272 KB
testcase_23 AC 225 ms
103,644 KB
testcase_24 AC 38 ms
53,816 KB
testcase_25 AC 50 ms
63,784 KB
testcase_26 AC 47 ms
62,276 KB
testcase_27 AC 42 ms
60,004 KB
testcase_28 AC 76 ms
69,896 KB
testcase_29 AC 60 ms
67,112 KB
testcase_30 AC 50 ms
63,052 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
for _ in range(100):
    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