結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー 👑 colognecologne
提出日時 2022-01-25 11:17:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 254 ms / 5,000 ms
コード長 477 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 115,740 KB
最終ジャッジ日時 2024-04-26 01:29:35
合計ジャッジ時間 7,373 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 206 ms
107,508 KB
testcase_01 AC 42 ms
60,708 KB
testcase_02 AC 120 ms
89,392 KB
testcase_03 AC 187 ms
101,476 KB
testcase_04 AC 253 ms
115,740 KB
testcase_05 AC 254 ms
115,172 KB
testcase_06 AC 243 ms
115,572 KB
testcase_07 AC 249 ms
107,204 KB
testcase_08 AC 246 ms
107,456 KB
testcase_09 AC 229 ms
107,076 KB
testcase_10 AC 230 ms
107,076 KB
testcase_11 AC 239 ms
110,700 KB
testcase_12 AC 206 ms
106,672 KB
testcase_13 AC 227 ms
102,304 KB
testcase_14 AC 237 ms
106,540 KB
testcase_15 AC 210 ms
107,096 KB
testcase_16 AC 215 ms
115,724 KB
testcase_17 AC 213 ms
115,248 KB
testcase_18 AC 207 ms
115,364 KB
testcase_19 AC 205 ms
107,700 KB
testcase_20 AC 206 ms
107,196 KB
testcase_21 AC 213 ms
107,212 KB
testcase_22 AC 181 ms
107,460 KB
testcase_23 AC 191 ms
111,344 KB
testcase_24 AC 38 ms
52,596 KB
testcase_25 AC 49 ms
65,516 KB
testcase_26 AC 45 ms
63,296 KB
testcase_27 AC 43 ms
60,144 KB
testcase_28 AC 79 ms
80,528 KB
testcase_29 AC 65 ms
76,728 KB
testcase_30 AC 48 ms
65,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math


def input(): return sys.stdin.readline().rstrip()


def main():
    int(input())  # N
    *L, = map(int, input().split())
    K = int(input())

    def yes(x):
        return sum(math.floor(le/x) for le in L) >= K

    ok = 0
    ng = max(L) + 1
    while abs(ok-ng) / max(ok, ng, 1) > 1e-12:
        mi = (ok+ng)/2
        if yes(mi):
            ok = mi
        else:
            ng = mi

    print((ok+ng)/2)


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