結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー 👑 rin204rin204
提出日時 2022-07-02 19:47:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,210 ms / 5,000 ms
コード長 337 bytes
コンパイル時間 650 ms
コンパイル使用メモリ 82,492 KB
実行使用メモリ 107,804 KB
最終ジャッジ日時 2024-04-26 01:36:31
合計ジャッジ時間 29,579 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
102,144 KB
testcase_01 AC 42 ms
59,068 KB
testcase_02 AC 823 ms
80,808 KB
testcase_03 AC 1,594 ms
98,252 KB
testcase_04 AC 1,503 ms
106,580 KB
testcase_05 AC 1,487 ms
106,332 KB
testcase_06 AC 1,199 ms
106,964 KB
testcase_07 AC 2,210 ms
102,188 KB
testcase_08 AC 2,198 ms
102,056 KB
testcase_09 AC 1,676 ms
102,388 KB
testcase_10 AC 1,368 ms
101,092 KB
testcase_11 AC 1,426 ms
106,244 KB
testcase_12 AC 1,034 ms
100,616 KB
testcase_13 AC 1,967 ms
104,744 KB
testcase_14 AC 2,115 ms
107,804 KB
testcase_15 AC 1,488 ms
104,288 KB
testcase_16 AC 671 ms
106,288 KB
testcase_17 AC 583 ms
104,916 KB
testcase_18 AC 528 ms
104,248 KB
testcase_19 AC 605 ms
102,100 KB
testcase_20 AC 509 ms
102,204 KB
testcase_21 AC 421 ms
102,212 KB
testcase_22 AC 404 ms
98,812 KB
testcase_23 AC 419 ms
103,796 KB
testcase_24 AC 38 ms
52,644 KB
testcase_25 AC 98 ms
62,880 KB
testcase_26 AC 67 ms
61,944 KB
testcase_27 AC 57 ms
60,284 KB
testcase_28 AC 396 ms
71,096 KB
testcase_29 AC 233 ms
66,396 KB
testcase_30 AC 98 ms
63,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
L = list(map(int, input().split()))
k = int(input())

def ok(x):
    cnt = 0
    for l in L:
        cnt += l // x
        if cnt >= k:
            return True
    return False

l = 0
r = 10 ** 9
for _ in range(100):
    mid = (l + r) / 2
    if ok(mid):
        l = mid
    else:
        r = mid
print((l + r) / 2)
    
0