結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー しらっ亭しらっ亭
提出日時 2016-03-11 00:17:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 268 ms / 5,000 ms
コード長 258 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 82,552 KB
実行使用メモリ 108,156 KB
最終ジャッジ日時 2024-04-25 23:38:19
合計ジャッジ時間 7,974 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 230 ms
102,364 KB
testcase_01 AC 42 ms
58,628 KB
testcase_02 AC 136 ms
87,500 KB
testcase_03 AC 203 ms
99,384 KB
testcase_04 AC 254 ms
107,932 KB
testcase_05 AC 254 ms
108,156 KB
testcase_06 AC 256 ms
107,988 KB
testcase_07 AC 267 ms
102,136 KB
testcase_08 AC 260 ms
102,252 KB
testcase_09 AC 263 ms
102,216 KB
testcase_10 AC 241 ms
104,048 KB
testcase_11 AC 250 ms
107,172 KB
testcase_12 AC 231 ms
103,704 KB
testcase_13 AC 245 ms
105,684 KB
testcase_14 AC 253 ms
107,704 KB
testcase_15 AC 232 ms
105,724 KB
testcase_16 AC 252 ms
107,516 KB
testcase_17 AC 252 ms
107,976 KB
testcase_18 AC 260 ms
107,532 KB
testcase_19 AC 265 ms
102,008 KB
testcase_20 AC 268 ms
102,132 KB
testcase_21 AC 267 ms
102,472 KB
testcase_22 AC 232 ms
103,780 KB
testcase_23 AC 247 ms
107,216 KB
testcase_24 AC 37 ms
52,756 KB
testcase_25 AC 58 ms
70,336 KB
testcase_26 AC 54 ms
66,260 KB
testcase_27 AC 49 ms
63,472 KB
testcase_28 AC 89 ms
79,384 KB
testcase_29 AC 72 ms
76,804 KB
testcase_30 AC 56 ms
70,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

L.sort()

l = L[-1] / K
r = L[-1] + 1

for _ in range(60):
    m = (l + r) / 2
    n = sum(int(l / m) for l in L)
    if n >= K:
        l = m
    else:
        r = m

print((l + r) / 2)
0