結果

問題 No.1042 愚直大学
ユーザー nephrologistnephrologist
提出日時 2020-05-01 21:55:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 29,668 KB
最終ジャッジ日時 2023-08-26 09:34:55
合計ジャッジ時間 4,831 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
29,528 KB
testcase_01 AC 136 ms
29,592 KB
testcase_02 AC 135 ms
29,516 KB
testcase_03 AC 135 ms
29,432 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 135 ms
29,428 KB
testcase_07 AC 132 ms
29,568 KB
testcase_08 AC 131 ms
29,436 KB
testcase_09 AC 133 ms
29,520 KB
testcase_10 AC 130 ms
29,480 KB
testcase_11 AC 131 ms
29,540 KB
testcase_12 AC 133 ms
29,468 KB
testcase_13 AC 131 ms
29,432 KB
testcase_14 AC 132 ms
29,520 KB
testcase_15 AC 134 ms
29,536 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 133 ms
29,524 KB
testcase_23 AC 131 ms
29,636 KB
testcase_24 AC 134 ms
29,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

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

ok = 1
ng = 10 ** 8


# def hantei(a):
#     takahashi = pow(2, (a * a - p))
#     hikuhashi = pow(2, (q * a)) * a
#     return takahashi <= hikuhashi


def hantei2(a):
    takahashi = a * a
    hikuhashi = p + q * a * np.log2(a)
    return takahashi <= hikuhashi



while ng - ok > 10 ** (-7):
    mid = (ok + ng) / 2
    if hantei2(mid):
        ok = mid
    else:
        ng = mid
print(ok)
0