結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-26 15:28:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 305 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 55,056 KB
最終ジャッジ日時 2023-10-24 23:28:43
合計ジャッジ時間 21,975 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 563 ms
55,056 KB
testcase_01 AC 459 ms
42,320 KB
testcase_02 AC 500 ms
44,924 KB
testcase_03 AC 534 ms
50,604 KB
testcase_04 AC 566 ms
54,984 KB
testcase_05 AC 568 ms
54,972 KB
testcase_06 AC 566 ms
54,972 KB
testcase_07 AC 570 ms
54,836 KB
testcase_08 AC 569 ms
54,836 KB
testcase_09 AC 569 ms
54,836 KB
testcase_10 AC 554 ms
53,624 KB
testcase_11 AC 561 ms
54,312 KB
testcase_12 AC 550 ms
53,168 KB
testcase_13 AC 553 ms
53,616 KB
testcase_14 AC 558 ms
54,216 KB
testcase_15 AC 548 ms
52,436 KB
testcase_16 AC 563 ms
54,972 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 572 ms
54,836 KB
testcase_20 WA -
testcase_21 AC 572 ms
54,836 KB
testcase_22 AC 560 ms
53,636 KB
testcase_23 WA -
testcase_24 AC 469 ms
42,320 KB
testcase_25 AC 467 ms
42,320 KB
testcase_26 AC 468 ms
42,320 KB
testcase_27 AC 476 ms
42,320 KB
testcase_28 AC 479 ms
42,320 KB
testcase_29 AC 470 ms
42,320 KB
testcase_30 AC 476 ms
42,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
eps = 1e-9
N = int(input())
L = np.array(input().split(), dtype=np.float64)
K = int(input())


l = 0.
r = 1e9 + eps
for _ in range(100):
    m = (r + l) * 0.5
    if (L / m + eps).astype(np.int32).sum() >= K:
        l = m
    else:
        r = m

print("{:.10f}".format((l + r) * 0.5))
0