結果

問題 No.1042 愚直大学
ユーザー convexineqconvexineq
提出日時 2020-05-01 21:34:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 400 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 8,252 KB
最終ジャッジ日時 2023-08-26 07:10:04
合計ジャッジ時間 1,601 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,080 KB
testcase_01 AC 17 ms
8,080 KB
testcase_02 AC 16 ms
8,252 KB
testcase_03 AC 16 ms
8,128 KB
testcase_04 AC 16 ms
8,252 KB
testcase_05 AC 16 ms
8,064 KB
testcase_06 AC 16 ms
8,124 KB
testcase_07 AC 16 ms
8,112 KB
testcase_08 AC 16 ms
8,120 KB
testcase_09 AC 16 ms
8,240 KB
testcase_10 AC 16 ms
8,136 KB
testcase_11 AC 16 ms
8,124 KB
testcase_12 AC 16 ms
8,148 KB
testcase_13 AC 16 ms
8,124 KB
testcase_14 AC 16 ms
8,064 KB
testcase_15 AC 16 ms
8,064 KB
testcase_16 AC 16 ms
8,216 KB
testcase_17 AC 16 ms
8,228 KB
testcase_18 AC 16 ms
8,128 KB
testcase_19 AC 17 ms
8,144 KB
testcase_20 AC 16 ms
8,080 KB
testcase_21 AC 16 ms
8,128 KB
testcase_22 AC 16 ms
8,200 KB
testcase_23 AC 16 ms
8,212 KB
testcase_24 AC 16 ms
8,116 KB
権限があれば一括ダウンロードができます

ソースコード

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