結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー AEnAEn
提出日時 2022-12-15 01:49:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,507 ms / 5,000 ms
コード長 383 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,476 KB
実行使用メモリ 107,776 KB
最終ジャッジ日時 2024-04-26 05:42:39
合計ジャッジ時間 33,136 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
102,120 KB
testcase_01 AC 43 ms
58,624 KB
testcase_02 AC 965 ms
80,512 KB
testcase_03 AC 1,815 ms
96,512 KB
testcase_04 AC 1,717 ms
106,368 KB
testcase_05 AC 1,700 ms
106,496 KB
testcase_06 AC 1,360 ms
106,240 KB
testcase_07 AC 2,507 ms
102,016 KB
testcase_08 AC 2,499 ms
102,144 KB
testcase_09 AC 1,921 ms
102,280 KB
testcase_10 AC 1,546 ms
100,992 KB
testcase_11 AC 1,667 ms
104,448 KB
testcase_12 AC 1,197 ms
100,608 KB
testcase_13 AC 2,339 ms
104,572 KB
testcase_14 AC 2,377 ms
107,776 KB
testcase_15 AC 1,686 ms
104,136 KB
testcase_16 AC 788 ms
105,116 KB
testcase_17 AC 689 ms
104,704 KB
testcase_18 AC 643 ms
104,564 KB
testcase_19 AC 702 ms
102,016 KB
testcase_20 AC 639 ms
102,280 KB
testcase_21 AC 532 ms
102,144 KB
testcase_22 AC 81 ms
97,536 KB
testcase_23 AC 522 ms
103,424 KB
testcase_24 AC 39 ms
52,736 KB
testcase_25 AC 109 ms
62,848 KB
testcase_26 AC 71 ms
61,952 KB
testcase_27 AC 63 ms
60,996 KB
testcase_28 AC 463 ms
69,888 KB
testcase_29 AC 271 ms
65,664 KB
testcase_30 AC 111 ms
62,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = list(map(int, input().split()))
K = int(input())
if K==1:
    exit(print(max(L)))

def judge(l):
    cnt = 0
    for i in range(N):
        cnt += L[i]//l
        if cnt>=K:
            return True
    else:
        return False

ok, ng = 0, 10**11
for i in range(120):
    mid = (ok+ng)/2
    if judge(mid):
        ok = mid
    else:
        ng = mid
print(ok)
0