結果
問題 |
No.1042 愚直大学
|
ユーザー |
![]() |
提出日時 | 2020-05-01 21:54:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 159 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 44,676 KB |
最終ジャッジ日時 | 2024-12-25 03:54:28 |
合計ジャッジ時間 | 17,503 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | WA * 8 RE * 15 |
ソースコード
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 not hantei2(ng): ng *= 10 while ng - ok > 10 ** (-7): mid = (ok + ng) / 2 if hantei2(mid): ok = mid else: ng = mid print(ok)