結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー しらっ亭しらっ亭
提出日時 2015-08-03 03:31:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 4,417 ms / 5,000 ms
コード長 357 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,652 KB
最終ジャッジ日時 2024-04-25 23:30:56
合計ジャッジ時間 97,325 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,896 ms
32,552 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 1,678 ms
18,896 KB
testcase_03 AC 3,155 ms
26,564 KB
testcase_04 AC 4,378 ms
29,220 KB
testcase_05 AC 4,357 ms
29,344 KB
testcase_06 AC 4,382 ms
29,344 KB
testcase_07 AC 4,383 ms
32,648 KB
testcase_08 AC 4,417 ms
32,520 KB
testcase_09 AC 4,376 ms
32,524 KB
testcase_10 AC 3,961 ms
27,640 KB
testcase_11 AC 4,220 ms
28,408 KB
testcase_12 AC 3,657 ms
26,836 KB
testcase_13 AC 4,036 ms
31,020 KB
testcase_14 AC 4,194 ms
31,948 KB
testcase_15 AC 3,709 ms
29,264 KB
testcase_16 AC 4,066 ms
29,220 KB
testcase_17 AC 4,073 ms
29,208 KB
testcase_18 AC 4,012 ms
29,216 KB
testcase_19 AC 3,949 ms
32,652 KB
testcase_20 AC 3,901 ms
32,520 KB
testcase_21 AC 3,920 ms
32,648 KB
testcase_22 AC 3,720 ms
27,524 KB
testcase_23 AC 3,897 ms
28,544 KB
testcase_24 AC 29 ms
10,752 KB
testcase_25 AC 115 ms
11,136 KB
testcase_26 AC 59 ms
10,880 KB
testcase_27 AC 49 ms
10,624 KB
testcase_28 AC 734 ms
14,088 KB
testcase_29 AC 388 ms
12,272 KB
testcase_30 AC 119 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    a = 0
    b = max(L)

    for i in range(100):
        c = (a + b) / 2
        n = sum(int(l/c) for l in L)
        if n >= K:
            a = c
        else:
            b = c

    print(a)


def main():
    solve()


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