結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 697 ms
56,352 KB
testcase_01 WA -
testcase_02 AC 551 ms
46,320 KB
testcase_03 AC 630 ms
52,128 KB
testcase_04 AC 702 ms
54,984 KB
testcase_05 AC 711 ms
54,972 KB
testcase_06 AC 699 ms
54,972 KB
testcase_07 AC 703 ms
56,088 KB
testcase_08 AC 702 ms
56,088 KB
testcase_09 AC 711 ms
56,088 KB
testcase_10 AC 675 ms
53,612 KB
testcase_11 AC 691 ms
54,440 KB
testcase_12 AC 676 ms
53,364 KB
testcase_13 AC 685 ms
55,032 KB
testcase_14 AC 704 ms
55,560 KB
testcase_15 AC 672 ms
53,976 KB
testcase_16 AC 711 ms
54,972 KB
testcase_17 AC 709 ms
54,964 KB
testcase_18 AC 705 ms
54,972 KB
testcase_19 AC 718 ms
56,088 KB
testcase_20 AC 714 ms
56,088 KB
testcase_21 AC 708 ms
56,088 KB
testcase_22 AC 683 ms
53,628 KB
testcase_23 AC 697 ms
54,440 KB
testcase_24 WA -
testcase_25 AC 489 ms
42,256 KB
testcase_26 WA -
testcase_27 AC 489 ms
42,256 KB
testcase_28 AC 515 ms
43,680 KB
testcase_29 AC 487 ms
42,376 KB
testcase_30 AC 492 ms
42,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


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

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