結果

問題 No.1042 愚直大学
ユーザー convexineq
提出日時 2020-05-01 21:34:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-24 22:29:13
合計ジャッジ時間 1,815 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

#n,m,s = [int(i) for i in readline().split()]
p,q = [int(i) for i in readline().split()]

from math import log
def f(x,p,q):
    return p + q*x*log(x,2) - x*x

ok = 1.0
ng = 10**18

for _ in range(100):
    mid = (ok+ng)/2
    if f(mid,p,q) > 0:
        ok = mid
    else:
        ng = mid

print(ok)

0