結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
29,536 KB
testcase_01 AC 120 ms
29,408 KB
testcase_02 AC 118 ms
29,488 KB
testcase_03 AC 119 ms
29,420 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 117 ms
29,428 KB
testcase_07 AC 115 ms
29,548 KB
testcase_08 AC 119 ms
29,528 KB
testcase_09 AC 115 ms
29,524 KB
testcase_10 AC 118 ms
29,396 KB
testcase_11 AC 118 ms
29,516 KB
testcase_12 AC 117 ms
29,476 KB
testcase_13 AC 117 ms
29,496 KB
testcase_14 AC 117 ms
29,536 KB
testcase_15 AC 116 ms
29,388 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 120 ms
29,432 KB
testcase_19 WA -
testcase_20 AC 116 ms
29,444 KB
testcase_21 AC 117 ms
29,480 KB
testcase_22 AC 118 ms
29,416 KB
testcase_23 AC 119 ms
29,472 KB
testcase_24 AC 118 ms
29,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

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

ok = 1
ng = 10 ** 10


# 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 ** (-6):
    mid = (ok + ng) / 2
    if hantei2(mid):
        ok = mid
    else:
        ng = mid
print(ok)
0