結果

問題 No.2970 三次関数の絶対値
ユーザー ecottea
提出日時 2024-11-30 03:01:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 129,192 KB
最終ジャッジ日時 2024-11-30 03:03:08
合計ジャッジ時間 67,265 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 47 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
from scipy.optimize import minimize_scalar, shgo, minimize

c0, c1, c2, c3 = map(int, input().split())
l, r = map(int, input().split())

def f(x):
    return abs(c0 + c1 * x + c2 * x**2 + c3 * x**3)

res = minimize_scalar(f, bounds=(l, r), method="bounded")
print('{:f}'.format(res.fun))
0