結果

問題 No.67 よくある棒を切る問題 (1)
コンテスト
ユーザー 大塚遥
提出日時 2023-08-26 23:05:04
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 3,034 ms / 5,000 ms
コード長 405 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 662 ms
コンパイル使用メモリ 21,412 KB
実行使用メモリ 36,904 KB
最終ジャッジ日時 2026-07-06 19:26:15
合計ジャッジ時間 57,009 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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
inde = 0
while inde <= 100:
    inde += 1
    mid = (ng + ok) / 2
    if is_ok(mid):
        ok = mid
    else:
        ng = mid
    # print(ok,ng)
print(ok)

0