結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 632 ms
101,684 KB
testcase_01 AC 41 ms
59,488 KB
testcase_02 AC 505 ms
79,380 KB
testcase_03 AC 934 ms
94,892 KB
testcase_04 AC 917 ms
103,476 KB
testcase_05 AC 912 ms
103,480 KB
testcase_06 AC 721 ms
103,468 KB
testcase_07 AC 1,297 ms
101,496 KB
testcase_08 AC 1,408 ms
101,364 KB
testcase_09 AC 1,032 ms
101,364 KB
testcase_10 AC 839 ms
99,268 KB
testcase_11 AC 875 ms
102,688 KB
testcase_12 AC 646 ms
99,092 KB
testcase_13 AC 1,186 ms
104,020 KB
testcase_14 AC 1,235 ms
107,224 KB
testcase_15 AC 899 ms
103,644 KB
testcase_16 AC 431 ms
103,068 KB
testcase_17 AC 374 ms
102,876 KB
testcase_18 AC 356 ms
102,876 KB
testcase_19 AC 480 ms
101,364 KB
testcase_20 AC 372 ms
101,364 KB
testcase_21 AC 374 ms
101,364 KB
testcase_22 AC 323 ms
99,260 KB
testcase_23 AC 340 ms
102,620 KB
testcase_24 AC 38 ms
53,432 KB
testcase_25 AC 74 ms
62,076 KB
testcase_26 AC 58 ms
62,080 KB
testcase_27 AC 52 ms
59,504 KB
testcase_28 AC 252 ms
69,648 KB
testcase_29 AC 155 ms
64,700 KB
testcase_30 AC 78 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(60):
        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