結果
問題 | No.67 よくある棒を切る問題 (1) |
ユーザー | はむ吉🐹 |
提出日時 | 2016-03-08 20:34:18 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,871 ms / 5,000 ms |
コード長 | 680 bytes |
コンパイル時間 | 444 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 27,200 KB |
最終ジャッジ日時 | 2024-11-08 11:48:27 |
合計ジャッジ時間 | 32,972 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import array import math def compute_max_length(n, ls, k): if k == 1: return max(ls) eps = 10.0 ** (-10) high = 10.0 ** 9 low = eps while high - low > eps and (high - low) / low > eps: mid = (high + low) / 2 num_of_sticks = sum(math.floor(l / mid) for l in ls) if num_of_sticks >= k: low = mid else: high = mid return (high + low) / 2 def main(): n = int(input()) ls = array.array("L", map(int, input().split())) k = int(input()) print("{:.16f}".format(compute_max_length(n, ls, k))) if __name__ == '__main__': main()