結果

問題 No.1042 愚直大学
ユーザー maspymaspy
提出日時 2020-05-01 22:46:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 428 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 95,760 KB
最終ジャッジ日時 2023-08-26 15:29:33
合計ジャッジ時間 12,707 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 428 ms
56,584 KB
testcase_01 AC 266 ms
56,196 KB
testcase_02 AC 261 ms
56,316 KB
testcase_03 AC 264 ms
56,376 KB
testcase_04 AC 265 ms
56,304 KB
testcase_05 AC 257 ms
56,176 KB
testcase_06 AC 260 ms
56,444 KB
testcase_07 AC 268 ms
56,220 KB
testcase_08 AC 263 ms
56,276 KB
testcase_09 AC 266 ms
56,496 KB
testcase_10 AC 261 ms
56,396 KB
testcase_11 AC 260 ms
56,468 KB
testcase_12 AC 257 ms
56,540 KB
testcase_13 AC 257 ms
56,452 KB
testcase_14 AC 262 ms
56,276 KB
testcase_15 AC 259 ms
56,464 KB
testcase_16 AC 261 ms
56,192 KB
testcase_17 AC 263 ms
56,444 KB
testcase_18 AC 266 ms
56,508 KB
testcase_19 AC 262 ms
56,464 KB
testcase_20 AC 275 ms
56,492 KB
testcase_21 AC 268 ms
56,696 KB
testcase_22 AC 266 ms
56,256 KB
testcase_23 AC 274 ms
56,476 KB
testcase_24 AC 275 ms
95,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from scipy.optimize import newton
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

P, Q = map(int, read().split())

def f(x):
    return x * x - Q * x * np.log2(x) - P

x = newton(f, x0=10**20, maxiter=1000)
print(x)
0