結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー kohei2019kohei2019
提出日時 2021-05-22 14:14:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,443 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 82,772 KB
実行使用メモリ 108,052 KB
最終ジャッジ日時 2024-04-26 01:21:02
合計ジャッジ時間 21,379 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 559 ms
102,488 KB
testcase_01 AC 41 ms
58,572 KB
testcase_02 AC 561 ms
79,608 KB
testcase_03 AC 1,039 ms
95,692 KB
testcase_04 AC 925 ms
103,896 KB
testcase_05 AC 929 ms
105,116 KB
testcase_06 AC 750 ms
103,880 KB
testcase_07 AC 1,426 ms
102,380 KB
testcase_08 AC 1,443 ms
102,460 KB
testcase_09 AC 1,137 ms
102,396 KB
testcase_10 AC 866 ms
100,328 KB
testcase_11 AC 887 ms
104,612 KB
testcase_12 AC 665 ms
99,436 KB
testcase_13 AC 1,320 ms
104,848 KB
testcase_14 AC 1,338 ms
108,052 KB
testcase_15 AC 1,001 ms
104,236 KB
testcase_16 AC 463 ms
104,096 KB
testcase_17 AC 408 ms
104,168 KB
testcase_18 AC 394 ms
104,308 KB
testcase_19 AC 431 ms
102,608 KB
testcase_20 AC 407 ms
102,596 KB
testcase_21 AC 399 ms
102,284 KB
testcase_22 AC 359 ms
99,204 KB
testcase_23 AC 378 ms
103,344 KB
testcase_24 AC 39 ms
53,488 KB
testcase_25 AC 73 ms
63,012 KB
testcase_26 AC 54 ms
62,428 KB
testcase_27 AC 50 ms
60,928 KB
testcase_28 AC 273 ms
70,416 KB
testcase_29 AC 165 ms
64,524 KB
testcase_30 AC 77 ms
61,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lsL = list(map(int,input().split()))
K = int(input())

def is_ok(arg):
    cnt = 0
    d = (arg*(10**(-9)))
    for i in range(N):
        cnt += lsL[i]//d
    return cnt >= K
 
def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok
print(meguru_bisect(10**20,0)*(10**(-9)))
0