結果

問題 No.1042 愚直大学
ユーザー yuly3yuly3
提出日時 2020-05-01 21:53:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 76,556 KB
最終ジャッジ日時 2023-08-26 09:26:54
合計ジャッジ時間 3,459 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,500 KB
testcase_01 AC 81 ms
76,440 KB
testcase_02 AC 80 ms
76,472 KB
testcase_03 AC 79 ms
76,348 KB
testcase_04 AC 79 ms
76,236 KB
testcase_05 AC 79 ms
76,364 KB
testcase_06 AC 79 ms
76,404 KB
testcase_07 AC 79 ms
76,204 KB
testcase_08 AC 77 ms
76,320 KB
testcase_09 AC 77 ms
76,252 KB
testcase_10 AC 78 ms
76,324 KB
testcase_11 AC 78 ms
76,248 KB
testcase_12 AC 77 ms
76,292 KB
testcase_13 AC 77 ms
76,500 KB
testcase_14 AC 76 ms
76,364 KB
testcase_15 AC 79 ms
76,304 KB
testcase_16 AC 79 ms
76,392 KB
testcase_17 AC 78 ms
76,440 KB
testcase_18 AC 79 ms
76,556 KB
testcase_19 AC 78 ms
76,344 KB
testcase_20 AC 78 ms
76,396 KB
testcase_21 AC 78 ms
76,416 KB
testcase_22 AC 78 ms
76,396 KB
testcase_23 AC 79 ms
76,252 KB
testcase_24 AC 79 ms
76,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from math import log2

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    P, Q = map(int, rl().split())
    
    def check(t):
        taka = t ** 2
        hiku = P + Q * t * log2(t)
        return taka <= hiku
    
    ok, ng = 1., 10 ** 18
    for _ in range(10000):
        mid = (ok + ng) / 2
        if check(mid):
            ok = mid
        else:
            ng = mid
    print(ok)


if __name__ == '__main__':
    solve()
0