結果

問題 No.1042 愚直大学
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-02-27 20:03:12
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 691 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 8,296 KB
最終ジャッジ日時 2023-09-19 07:20:38
合計ジャッジ時間 1,862 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,076 KB
testcase_01 AC 17 ms
8,212 KB
testcase_02 AC 17 ms
8,156 KB
testcase_03 AC 17 ms
8,080 KB
testcase_04 AC 17 ms
8,256 KB
testcase_05 AC 17 ms
8,264 KB
testcase_06 AC 18 ms
8,224 KB
testcase_07 AC 17 ms
8,156 KB
testcase_08 AC 17 ms
8,224 KB
testcase_09 AC 17 ms
8,260 KB
testcase_10 AC 17 ms
8,212 KB
testcase_11 AC 17 ms
8,296 KB
testcase_12 AC 18 ms
8,208 KB
testcase_13 AC 17 ms
8,212 KB
testcase_14 AC 17 ms
8,292 KB
testcase_15 AC 17 ms
8,148 KB
testcase_16 AC 17 ms
8,092 KB
testcase_17 AC 17 ms
8,112 KB
testcase_18 AC 17 ms
8,112 KB
testcase_19 AC 17 ms
8,212 KB
testcase_20 AC 17 ms
8,108 KB
testcase_21 AC 17 ms
8,148 KB
testcase_22 AC 18 ms
8,256 KB
testcase_23 AC 17 ms
8,076 KB
testcase_24 AC 17 ms
8,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    P,Q = map(int,input().split())
    
    import math
    
    def is_ok(x):
        return x**2 - (P+Q*x*math.log2(x))<0
        
    y = pow(10,20)
    x = 1
    for _ in range(2000):
        mid = (y+x)/2
        if is_ok(mid):
            x = mid
        else:
            y = mid
    print(x)
main()
0