結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー しらっ亭しらっ亭
提出日時 2016-02-23 17:26:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,693 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 33,392 KB
最終ジャッジ日時 2024-04-25 23:37:52
合計ジャッジ時間 61,169 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,428 ms
32,680 KB
testcase_01 AC 28 ms
10,752 KB
testcase_02 AC 1,033 ms
18,892 KB
testcase_03 AC 1,988 ms
26,444 KB
testcase_04 AC 2,687 ms
29,216 KB
testcase_05 AC 2,663 ms
29,344 KB
testcase_06 AC 2,596 ms
29,344 KB
testcase_07 AC 2,691 ms
33,392 KB
testcase_08 AC 2,693 ms
33,388 KB
testcase_09 AC 2,630 ms
33,392 KB
testcase_10 AC 2,410 ms
26,428 KB
testcase_11 AC 2,493 ms
28,532 KB
testcase_12 AC 2,262 ms
26,656 KB
testcase_13 AC 2,505 ms
31,148 KB
testcase_14 AC 2,569 ms
32,320 KB
testcase_15 AC 2,220 ms
30,128 KB
testcase_16 AC 2,526 ms
29,216 KB
testcase_17 AC 2,570 ms
29,232 KB
testcase_18 AC 2,575 ms
29,216 KB
testcase_19 AC 2,473 ms
33,264 KB
testcase_20 AC 2,487 ms
33,384 KB
testcase_21 AC 2,464 ms
33,268 KB
testcase_22 AC 2,316 ms
27,488 KB
testcase_23 AC 2,475 ms
28,420 KB
testcase_24 AC 29 ms
10,752 KB
testcase_25 AC 83 ms
11,136 KB
testcase_26 AC 50 ms
10,880 KB
testcase_27 AC 43 ms
10,752 KB
testcase_28 AC 463 ms
14,208 KB
testcase_29 AC 246 ms
12,272 KB
testcase_30 AC 86 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    l = max(L) / K
    r = max(L) + 1

    for i 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)


def main():
    solve()


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