結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー YamadaYamada
提出日時 2019-01-17 16:39:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,188 ms / 5,000 ms
コード長 431 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,692 KB
最終ジャッジ日時 2024-04-26 00:38:02
合計ジャッジ時間 39,971 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,235 ms
32,692 KB
testcase_01 AC 29 ms
10,880 KB
testcase_02 AC 773 ms
19,048 KB
testcase_03 AC 1,503 ms
26,584 KB
testcase_04 AC 2,167 ms
29,492 KB
testcase_05 AC 2,188 ms
29,364 KB
testcase_06 AC 1,884 ms
29,368 KB
testcase_07 AC 2,069 ms
32,676 KB
testcase_08 AC 2,069 ms
32,664 KB
testcase_09 AC 1,705 ms
32,668 KB
testcase_10 AC 1,987 ms
26,576 KB
testcase_11 AC 2,087 ms
28,556 KB
testcase_12 AC 1,607 ms
25,932 KB
testcase_13 AC 1,886 ms
30,828 KB
testcase_14 AC 1,945 ms
31,588 KB
testcase_15 AC 1,508 ms
29,412 KB
testcase_16 AC 1,447 ms
29,368 KB
testcase_17 AC 1,373 ms
29,352 KB
testcase_18 AC 1,146 ms
29,492 KB
testcase_19 AC 1,240 ms
32,672 KB
testcase_20 AC 1,134 ms
32,672 KB
testcase_21 AC 1,111 ms
32,668 KB
testcase_22 AC 1,011 ms
26,584 KB
testcase_23 AC 1,090 ms
28,560 KB
testcase_24 AC 28 ms
10,752 KB
testcase_25 AC 72 ms
11,264 KB
testcase_26 AC 44 ms
10,880 KB
testcase_27 AC 40 ms
10,880 KB
testcase_28 AC 364 ms
14,184 KB
testcase_29 AC 206 ms
12,416 KB
testcase_30 AC 76 ms
11,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N =int(input())
li =[int(i)for i in input().split()]
K =int(input())

def wa(L,d):
    n = 0
    for i in L:
        n += int(i/d)
    return n

def nibuntansaku(l,s):
    left = max(l)+1
    right =0
    mid =(left+right)/2.0
    while abs(right -left)/mid > 10**(-9):
        mid = (left + right)/2.0
        if wa(l,mid) >= s:
            right =mid
        else:
            left =mid
    return right
print(nibuntansaku(li,K))
0