結果

問題 No.1042 愚直大学
ユーザー vwxyzvwxyz
提出日時 2024-04-15 12:41:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 525 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-15 12:41:03
合計ジャッジ時間 1,983 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,624 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 32 ms
10,752 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 32 ms
10,752 KB
testcase_07 AC 32 ms
10,624 KB
testcase_08 AC 32 ms
10,624 KB
testcase_09 AC 32 ms
10,752 KB
testcase_10 AC 31 ms
10,624 KB
testcase_11 AC 32 ms
10,752 KB
testcase_12 AC 35 ms
10,752 KB
testcase_13 AC 32 ms
10,624 KB
testcase_14 AC 32 ms
10,624 KB
testcase_15 AC 32 ms
10,752 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 32 ms
10,624 KB
testcase_19 WA -
testcase_20 AC 31 ms
10,752 KB
testcase_21 AC 32 ms
10,624 KB
testcase_22 AC 33 ms
10,752 KB
testcase_23 AC 33 ms
10,752 KB
testcase_24 AC 32 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def Bisect_Float(ok,ng,is_ok,eps=1e-12,cnt=0):
    if cnt:
        for _ in range(cnt):
            mid=(ok+ng)/2
            if is_ok(mid):
                ok=mid
            else:
                ng=mid
    else:
        while abs(ok-ng)/max(ok,ng,1)>eps:
            mid=(ok+ng)/2
            if is_ok(mid):
                ok=mid
            else:
                ng=mid
    return ok

P,Q=map(int,input().split())
def is_ok(N):
    return N*N>P+Q*N*math.log2(N)
ans=Bisect_Float(1e10,1e-10,is_ok)
print(ans)
0