結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー H3PO4H3PO4
提出日時 2020-04-23 12:01:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,402 ms / 5,000 ms
コード長 246 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 63,072 KB
最終ジャッジ日時 2024-04-26 01:03:23
合計ジャッジ時間 44,451 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,061 ms
62,824 KB
testcase_01 AC 520 ms
44,048 KB
testcase_02 AC 1,226 ms
49,936 KB
testcase_03 AC 1,898 ms
56,684 KB
testcase_04 AC 1,902 ms
58,060 KB
testcase_05 AC 1,880 ms
58,184 KB
testcase_06 AC 1,530 ms
58,320 KB
testcase_07 AC 2,402 ms
62,816 KB
testcase_08 AC 2,401 ms
62,820 KB
testcase_09 AC 1,938 ms
62,692 KB
testcase_10 AC 1,731 ms
57,020 KB
testcase_11 AC 1,818 ms
57,320 KB
testcase_12 AC 1,389 ms
56,628 KB
testcase_13 AC 2,241 ms
60,872 KB
testcase_14 AC 2,331 ms
61,836 KB
testcase_15 AC 1,744 ms
59,296 KB
testcase_16 AC 1,098 ms
57,928 KB
testcase_17 AC 1,044 ms
58,044 KB
testcase_18 AC 1,007 ms
57,924 KB
testcase_19 AC 875 ms
62,564 KB
testcase_20 AC 853 ms
62,948 KB
testcase_21 AC 866 ms
63,072 KB
testcase_22 AC 963 ms
56,976 KB
testcase_23 AC 970 ms
57,208 KB
testcase_24 AC 500 ms
44,312 KB
testcase_25 AC 540 ms
44,056 KB
testcase_26 AC 506 ms
43,928 KB
testcase_27 AC 508 ms
44,568 KB
testcase_28 AC 801 ms
45,332 KB
testcase_29 AC 663 ms
44,052 KB
testcase_30 AC 538 ms
44,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N = int(input())
L = np.array(tuple(map(int, input().split())))
K = int(input())
l, r = 0, 10 ** 9

for _ in range(100):
    m = (l + r) / 2
    if (L // m).astype(int).sum() < K:
        r = m
    else:
        l = m
print(l)
0