結果
| 問題 | No.68 よくある棒を切る問題 (2) | 
| コンテスト | |
| ユーザー |  gew1fw | 
| 提出日時 | 2025-06-12 13:11:28 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 999 bytes | 
| コンパイル時間 | 165 ms | 
| コンパイル使用メモリ | 82,476 KB | 
| 実行使用メモリ | 124,120 KB | 
| 最終ジャッジ日時 | 2025-06-12 13:14:41 | 
| 合計ジャッジ時間 | 13,079 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | TLE * 1 -- * 9 | 
ソースコード
import bisect
def main():
    import sys
    input = sys.stdin.read().split()
    ptr = 0
    N = int(input[ptr])
    ptr += 1
    L = list(map(int, input[ptr:ptr+N]))
    ptr += N
    L.sort()
    Q = int(input[ptr])
    ptr += 1
    K_list = list(map(int, input[ptr:ptr+Q]))
    ptr += Q
    max_L = L[-1] if N > 0 else 0
    for K in K_list:
        low = 0.0
        high = float(max_L)
        for _ in range(100):
            mid = (low + high) / 2
            if mid == 0:
                current_sum = 0
            else:
                idx = bisect.bisect_left(L, mid)
                current_sum = 0
                for i in range(idx, N):
                    current_sum += L[i] // mid
                    if current_sum > K * 2:  # Early exit if sum exceeds K significantly
                        break
            if current_sum >= K:
                low = mid
            else:
                high = mid
        print("{0:.15f}".format(low))
if __name__ == "__main__":
    main()
            
            
            
        