結果
問題 |
No.1042 愚直大学
|
ユーザー |
![]() |
提出日時 | 2020-05-01 23:09:43 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 447 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 17,700 KB |
最終ジャッジ日時 | 2024-12-25 14:14:36 |
合計ジャッジ時間 | 4,820 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 TLE * 1 |
ソースコード
import math # p, q = map(int, input().split()) # def f(x): return x * x - q * x * math.log2(x) - p def fprime(x): return 2 * x - q * math.log2(x) - q / math.log(2) def newton(x_0, eps): x = x_0 while True: x_prev = x x = x_prev - f(x) / fprime(x) if abs(x - x_prev) < eps: break return x x0 = 1.0 while True: x0 *= 10 if f(x0) > 0: break eps = 1e-6 print(newton(x0, eps))