結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー qibqib
提出日時 2023-03-18 14:25:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 446 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 110,364 KB
最終ジャッジ日時 2023-10-18 17:17:33
合計ジャッジ時間 22,819 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
101,896 KB
testcase_01 AC 48 ms
62,032 KB
testcase_02 AC 1,897 ms
83,808 KB
testcase_03 AC 3,656 ms
97,656 KB
testcase_04 AC 4,101 ms
105,736 KB
testcase_05 AC 4,094 ms
105,736 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

EPS = 1.0e-11

n = int(input())
l = list(map(int, input().split()))
k = int(input())

ok = EPS
ng = 1.0e9 + EPS
while abs(ok - ng) > EPS:
  mid = (ok + ng) / 2

  cnt = 0
  for i in range(n):
    ok2 = 0
    ng2 = k + 1
    while abs(ok2 - ng2) > 1:
      mid2 = (ok2 + ng2) // 2

      if mid2 * mid <= l[i]:
        ok2 = mid2
      else:
        ng2 = mid2

    cnt += ok2

  if cnt >= k:
    ok = mid
  else:
    ng = mid

print(f"{ok:.12f}")
0