結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー mmd6688mmd6688
提出日時 2023-03-07 08:40:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,640 ms / 5,000 ms
コード長 368 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 81,584 KB
実行使用メモリ 107,224 KB
最終ジャッジ日時 2023-10-18 05:24:51
合計ジャッジ時間 22,952 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 666 ms
101,744 KB
testcase_01 AC 43 ms
59,488 KB
testcase_02 AC 589 ms
79,380 KB
testcase_03 AC 1,089 ms
94,908 KB
testcase_04 AC 1,073 ms
103,488 KB
testcase_05 AC 1,068 ms
103,488 KB
testcase_06 AC 833 ms
103,484 KB
testcase_07 AC 1,512 ms
101,364 KB
testcase_08 AC 1,640 ms
101,364 KB
testcase_09 AC 1,190 ms
101,364 KB
testcase_10 AC 975 ms
99,268 KB
testcase_11 AC 1,016 ms
102,700 KB
testcase_12 AC 730 ms
99,092 KB
testcase_13 AC 1,384 ms
104,020 KB
testcase_14 AC 1,440 ms
107,224 KB
testcase_15 AC 1,036 ms
103,644 KB
testcase_16 AC 480 ms
103,076 KB
testcase_17 AC 419 ms
102,876 KB
testcase_18 AC 394 ms
102,876 KB
testcase_19 AC 537 ms
101,364 KB
testcase_20 AC 413 ms
101,364 KB
testcase_21 AC 413 ms
101,364 KB
testcase_22 AC 355 ms
99,260 KB
testcase_23 AC 381 ms
102,620 KB
testcase_24 AC 38 ms
53,432 KB
testcase_25 AC 77 ms
62,076 KB
testcase_26 AC 58 ms
62,080 KB
testcase_27 AC 51 ms
59,504 KB
testcase_28 AC 289 ms
69,648 KB
testcase_29 AC 176 ms
64,700 KB
testcase_30 AC 84 ms
62,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = list(map(int, input().split()))
K = int(input())

def calc_bou(N, L, K):
    low = 0
    high = max(L)

    for _ in range(70):
        mid = (low + high) / 2
        cnt = 0
        for i in L:
            cnt += i // mid
        if cnt < K:
            high = mid
        else:
            low = mid
    
    return low

print(calc_bou(N, L, K))
0