結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー 大塚遥大塚遥
提出日時 2023-08-26 23:05:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 4,587 ms / 5,000 ms
コード長 405 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 30,672 KB
最終ジャッジ日時 2023-08-26 23:06:21
合計ジャッジ時間 70,415 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
30,672 KB
testcase_01 AC 15 ms
7,832 KB
testcase_02 AC 1,734 ms
16,300 KB
testcase_03 AC 3,279 ms
23,944 KB
testcase_04 AC 3,940 ms
28,852 KB
testcase_05 AC 3,934 ms
28,892 KB
testcase_06 AC 3,089 ms
28,896 KB
testcase_07 AC 4,548 ms
30,036 KB
testcase_08 AC 4,587 ms
29,976 KB
testcase_09 AC 3,451 ms
29,948 KB
testcase_10 AC 3,464 ms
28,352 KB
testcase_11 AC 3,668 ms
28,080 KB
testcase_12 AC 2,668 ms
26,156 KB
testcase_13 AC 4,177 ms
28,460 KB
testcase_14 AC 4,273 ms
29,364 KB
testcase_15 AC 2,981 ms
26,856 KB
testcase_16 AC 2,711 ms
28,932 KB
testcase_17 AC 2,490 ms
28,756 KB
testcase_18 AC 2,335 ms
28,816 KB
testcase_19 AC 2,454 ms
29,904 KB
testcase_20 AC 2,283 ms
29,912 KB
testcase_21 AC 1,633 ms
29,976 KB
testcase_22 AC 1,707 ms
28,020 KB
testcase_23 AC 1,706 ms
28,020 KB
testcase_24 AC 14 ms
7,780 KB
testcase_25 AC 106 ms
8,652 KB
testcase_26 AC 50 ms
8,384 KB
testcase_27 AC 36 ms
7,824 KB
testcase_28 AC 736 ms
11,688 KB
testcase_29 AC 394 ms
9,796 KB
testcase_30 AC 115 ms
8,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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