結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー 大塚遥大塚遥
提出日時 2023-08-26 23:00:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 391 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 11,156 KB
実行使用メモリ 30,744 KB
最終ジャッジ日時 2023-08-26 23:01:02
合計ジャッジ時間 25,039 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
30,744 KB
testcase_01 AC 14 ms
7,848 KB
testcase_02 AC 1,078 ms
16,472 KB
testcase_03 AC 2,059 ms
24,112 KB
testcase_04 AC 2,510 ms
29,008 KB
testcase_05 AC 2,452 ms
29,068 KB
testcase_06 AC 1,975 ms
29,192 KB
testcase_07 AC 2,917 ms
30,112 KB
testcase_08 AC 3,060 ms
30,092 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ok = 0
ng = 10**9


def is_ok(x):
    cnt = 0
    for i in range(N):
        num = L[i] // x
        cnt += num
        if cnt >= K:
            return 1
        
    return 0

while ng - ok > 10**(-10):
    mid = (ng + ok) / 2
    if is_ok(mid):
        ok = mid
    else:
        ng = mid
    # print(ok,ng)
print(ok)

0