結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー しらっ亭しらっ亭
提出日時 2015-08-03 03:37:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 302 ms / 5,000 ms
コード長 357 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 82,564 KB
実行使用メモリ 107,496 KB
最終ジャッジ日時 2024-04-25 23:27:19
合計ジャッジ時間 8,630 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 291 ms
102,248 KB
testcase_01 AC 43 ms
59,692 KB
testcase_02 AC 137 ms
86,896 KB
testcase_03 AC 217 ms
98,048 KB
testcase_04 AC 280 ms
106,268 KB
testcase_05 AC 280 ms
106,424 KB
testcase_06 AC 280 ms
106,184 KB
testcase_07 AC 302 ms
102,312 KB
testcase_08 AC 288 ms
102,344 KB
testcase_09 AC 280 ms
102,232 KB
testcase_10 AC 258 ms
102,352 KB
testcase_11 AC 270 ms
105,696 KB
testcase_12 AC 255 ms
102,208 KB
testcase_13 AC 264 ms
104,844 KB
testcase_14 AC 273 ms
107,496 KB
testcase_15 AC 250 ms
104,504 KB
testcase_16 AC 285 ms
105,972 KB
testcase_17 AC 277 ms
106,676 KB
testcase_18 AC 282 ms
106,316 KB
testcase_19 AC 289 ms
102,456 KB
testcase_20 AC 283 ms
102,392 KB
testcase_21 AC 293 ms
102,184 KB
testcase_22 AC 259 ms
102,516 KB
testcase_23 AC 271 ms
105,668 KB
testcase_24 AC 36 ms
53,576 KB
testcase_25 AC 49 ms
67,328 KB
testcase_26 AC 45 ms
63,512 KB
testcase_27 AC 43 ms
61,696 KB
testcase_28 AC 86 ms
78,920 KB
testcase_29 AC 68 ms
76,484 KB
testcase_30 AC 49 ms
68,236 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