結果

問題 No.1042 愚直大学
ユーザー neterukunneterukun
提出日時 2020-05-01 21:32:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 1,448 ms
コンパイル使用メモリ 86,676 KB
実行使用メモリ 76,596 KB
最終ジャッジ日時 2023-08-26 07:01:49
合計ジャッジ時間 3,496 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
76,596 KB
testcase_01 AC 67 ms
76,252 KB
testcase_02 AC 68 ms
76,568 KB
testcase_03 AC 69 ms
76,376 KB
testcase_04 AC 68 ms
76,384 KB
testcase_05 AC 70 ms
76,340 KB
testcase_06 AC 67 ms
76,144 KB
testcase_07 AC 68 ms
76,140 KB
testcase_08 AC 69 ms
76,272 KB
testcase_09 AC 70 ms
76,584 KB
testcase_10 AC 69 ms
76,344 KB
testcase_11 AC 69 ms
76,140 KB
testcase_12 AC 68 ms
76,412 KB
testcase_13 AC 68 ms
76,492 KB
testcase_14 AC 68 ms
76,540 KB
testcase_15 AC 69 ms
76,452 KB
testcase_16 AC 70 ms
76,548 KB
testcase_17 AC 69 ms
76,216 KB
testcase_18 AC 69 ms
76,420 KB
testcase_19 AC 68 ms
76,144 KB
testcase_20 AC 69 ms
76,248 KB
testcase_21 AC 69 ms
76,384 KB
testcase_22 AC 68 ms
76,408 KB
testcase_23 AC 68 ms
76,280 KB
testcase_24 AC 68 ms
76,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def solve(mid):
    taka = mid ** 2
    tei = p + q * mid * math.log2(mid)
    return taka <= tei

p, q = map(int, input().split())

ok = 1
ng = 10 ** 18
cnt = 0
while cnt < 10000:
    mid = (ok + ng) / 2
    if solve(mid):
        ok = mid
    else:
        ng = mid
    cnt += 1

print(ok)
0