結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー tnodinotnodino
提出日時 2022-03-06 14:46:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,158 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 82,504 KB
実行使用メモリ 107,936 KB
最終ジャッジ日時 2024-04-26 01:30:14
合計ジャッジ時間 30,285 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 716 ms
102,364 KB
testcase_01 AC 43 ms
58,560 KB
testcase_02 AC 801 ms
82,484 KB
testcase_03 AC 1,534 ms
98,472 KB
testcase_04 AC 1,451 ms
106,332 KB
testcase_05 AC 1,438 ms
106,344 KB
testcase_06 AC 1,161 ms
106,492 KB
testcase_07 AC 2,151 ms
102,216 KB
testcase_08 AC 2,158 ms
102,092 KB
testcase_09 AC 1,637 ms
101,972 KB
testcase_10 AC 1,342 ms
101,800 KB
testcase_11 AC 1,383 ms
106,280 KB
testcase_12 AC 1,024 ms
101,420 KB
testcase_13 AC 1,944 ms
104,760 KB
testcase_14 AC 2,026 ms
107,936 KB
testcase_15 AC 1,431 ms
104,516 KB
testcase_16 AC 646 ms
106,564 KB
testcase_17 AC 574 ms
106,476 KB
testcase_18 AC 546 ms
106,292 KB
testcase_19 AC 580 ms
101,984 KB
testcase_20 AC 582 ms
102,456 KB
testcase_21 AC 562 ms
102,228 KB
testcase_22 AC 498 ms
100,700 KB
testcase_23 AC 520 ms
104,284 KB
testcase_24 AC 37 ms
53,408 KB
testcase_25 AC 92 ms
64,412 KB
testcase_26 AC 64 ms
62,540 KB
testcase_27 AC 56 ms
60,304 KB
testcase_28 AC 423 ms
71,572 KB
testcase_29 AC 303 ms
66,624 KB
testcase_30 AC 95 ms
63,260 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