結果

問題 No.1042 愚直大学
ユーザー kit84kit84
提出日時 2020-05-01 22:32:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 720 ms / 2,000 ms
コード長 809 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,572 KB
実行使用メモリ 76,892 KB
最終ジャッジ日時 2023-08-26 15:12:43
合計ジャッジ時間 8,150 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,640 KB
testcase_01 AC 68 ms
71,936 KB
testcase_02 AC 62 ms
71,796 KB
testcase_03 AC 63 ms
71,852 KB
testcase_04 AC 653 ms
76,744 KB
testcase_05 AC 652 ms
76,440 KB
testcase_06 AC 67 ms
71,592 KB
testcase_07 AC 66 ms
71,904 KB
testcase_08 AC 66 ms
71,848 KB
testcase_09 AC 68 ms
71,672 KB
testcase_10 AC 65 ms
71,828 KB
testcase_11 AC 65 ms
71,560 KB
testcase_12 AC 62 ms
71,676 KB
testcase_13 AC 65 ms
71,872 KB
testcase_14 AC 65 ms
71,680 KB
testcase_15 AC 64 ms
71,504 KB
testcase_16 AC 713 ms
76,880 KB
testcase_17 AC 693 ms
76,608 KB
testcase_18 AC 710 ms
76,404 KB
testcase_19 AC 710 ms
76,892 KB
testcase_20 AC 708 ms
76,592 KB
testcase_21 AC 720 ms
76,608 KB
testcase_22 AC 66 ms
71,900 KB
testcase_23 AC 65 ms
71,664 KB
testcase_24 AC 64 ms
71,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

import math
log2 = math.log2
# from collections import deque

def linput(_t=int):
    return list(map(_t, input().split()))

def gcd(n,m):
    while m: n,m = m, n%m
    return n

def lcm(n,m): return n*m//gcd(n,m)

def main():
    # N = int(input())
    # K = int(input())
    P,Q = linput()

    # vA = linput()
    # vB = linput()
    # S = input().rstrip()
    # mX = [linput() for _ in [0,]*N]
    # res = 0

    L, R = 1.0, 10.0**19
    M = (L+R)/2

    cnt = 0
    LMAX = 10010010
    EPS = 10.0**-8
    while cnt<LMAX and abs(R-L)>EPS:
        if M*M <= P + M*Q*log2(M):
            L = M
        else:
            R = M
        M = (L+R)/2
        cnt += 1

    res = L
    # print(res)
    print("{:.7f}".format(res))

    # print(("No","Yes")[res%2])


main()
0