結果

問題 No.1042 愚直大学
ユーザー nephrologistnephrologist
提出日時 2020-05-01 21:58:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 11,132 KB
実行使用メモリ 29,564 KB
最終ジャッジ日時 2023-08-26 09:42:47
合計ジャッジ時間 5,016 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
29,468 KB
testcase_01 AC 130 ms
29,480 KB
testcase_02 AC 128 ms
29,476 KB
testcase_03 AC 129 ms
29,396 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 128 ms
29,492 KB
testcase_07 AC 129 ms
29,500 KB
testcase_08 AC 130 ms
29,368 KB
testcase_09 AC 130 ms
29,392 KB
testcase_10 AC 130 ms
29,564 KB
testcase_11 AC 129 ms
29,352 KB
testcase_12 AC 127 ms
29,352 KB
testcase_13 AC 128 ms
29,352 KB
testcase_14 AC 129 ms
29,432 KB
testcase_15 AC 129 ms
29,464 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 132 ms
29,360 KB
testcase_23 AC 129 ms
29,392 KB
testcase_24 AC 129 ms
29,352 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


if hantei2(ng) is False:
    ok *= 10 ** 7
    ng *= 10 ** 3

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