結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー tnodinotnodino
提出日時 2022-03-06 14:46:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,983 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 33,396 KB
最終ジャッジ日時 2024-04-26 01:32:00
合計ジャッジ時間 70,751 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,446 ms
32,676 KB
testcase_01 AC 28 ms
10,880 KB
testcase_02 AC 1,455 ms
19,152 KB
testcase_03 AC 2,770 ms
26,568 KB
testcase_04 AC 3,201 ms
29,344 KB
testcase_05 AC 3,188 ms
29,348 KB
testcase_06 AC 2,952 ms
29,344 KB
testcase_07 AC 3,901 ms
33,392 KB
testcase_08 AC 3,983 ms
33,396 KB
testcase_09 AC 3,413 ms
33,396 KB
testcase_10 AC 3,035 ms
26,552 KB
testcase_11 AC 3,147 ms
28,532 KB
testcase_12 AC 2,525 ms
26,652 KB
testcase_13 AC 3,628 ms
31,144 KB
testcase_14 AC 3,760 ms
32,408 KB
testcase_15 AC 2,968 ms
30,112 KB
testcase_16 AC 2,543 ms
29,352 KB
testcase_17 AC 2,469 ms
29,332 KB
testcase_18 AC 2,451 ms
29,340 KB
testcase_19 AC 2,361 ms
33,392 KB
testcase_20 AC 2,290 ms
33,388 KB
testcase_21 AC 2,329 ms
33,388 KB
testcase_22 AC 2,201 ms
27,656 KB
testcase_23 AC 2,281 ms
28,548 KB
testcase_24 AC 29 ms
10,880 KB
testcase_25 AC 110 ms
11,264 KB
testcase_26 AC 59 ms
11,008 KB
testcase_27 AC 49 ms
10,880 KB
testcase_28 AC 648 ms
14,212 KB
testcase_29 AC 347 ms
12,400 KB
testcase_30 AC 109 ms
11,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

N = int(input())
L = list(map(int,input().split()))
K = int(input())
ok = 0
ng = max(L) + 1
for _ in range(100):
    x = (ok + ng) / 2
    if Check(x):
        ok = x
    else:
        ng = x
print(ok)
0