結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー roknaoroknao
提出日時 2019-11-09 19:11:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,491 ms / 5,000 ms
コード長 665 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 82,984 KB
実行使用メモリ 260,056 KB
最終ジャッジ日時 2024-04-26 00:51:15
合計ジャッジ時間 34,253 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 910 ms
259,580 KB
testcase_01 AC 49 ms
63,748 KB
testcase_02 AC 870 ms
141,448 KB
testcase_03 AC 1,638 ms
191,464 KB
testcase_04 AC 1,677 ms
237,180 KB
testcase_05 AC 1,662 ms
236,780 KB
testcase_06 AC 1,333 ms
237,416 KB
testcase_07 AC 2,301 ms
259,416 KB
testcase_08 AC 2,491 ms
259,548 KB
testcase_09 AC 1,788 ms
259,784 KB
testcase_10 AC 1,516 ms
220,428 KB
testcase_11 AC 1,594 ms
228,424 KB
testcase_12 AC 1,150 ms
184,268 KB
testcase_13 AC 2,087 ms
240,304 KB
testcase_14 AC 2,181 ms
250,288 KB
testcase_15 AC 1,577 ms
229,576 KB
testcase_16 AC 798 ms
236,788 KB
testcase_17 AC 704 ms
236,796 KB
testcase_18 AC 683 ms
237,036 KB
testcase_19 AC 897 ms
260,056 KB
testcase_20 AC 712 ms
259,928 KB
testcase_21 AC 699 ms
259,676 KB
testcase_22 AC 620 ms
220,020 KB
testcase_23 AC 654 ms
228,720 KB
testcase_24 AC 46 ms
56,512 KB
testcase_25 AC 100 ms
68,152 KB
testcase_26 AC 71 ms
65,768 KB
testcase_27 AC 63 ms
63,828 KB
testcase_28 AC 422 ms
97,076 KB
testcase_29 AC 247 ms
77,144 KB
testcase_30 AC 107 ms
69,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import reduce
from math import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    def isOK(m):
        k = sum([l//m for l in L])
        return k >= K


    def binary_search(ok, ng):
        for _ in range(100):
            mid = (ok + ng) / 2
            if isOK(mid):
                ok = mid
            else:
                ng = mid
        return ok    


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

    ok = 0
    ng = 10**9 + 1

    print(binary_search(ok, ng))


if __name__ == '__main__':
    main()
0