結果

問題 No.1132 凸凹
ユーザー lloyz
提出日時 2022-06-16 21:14:56
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 305 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 536 ms
コンパイル使用メモリ 20,956 KB
実行使用メモリ 15,484 KB
最終ジャッジ日時 2026-04-23 19:55:15
合計ジャッジ時間 5,958 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

a, b, c, d, p, q = map(int, input().split())

min_x, min_f, max_x, max_f = p, 10**18, p, -10**18
for x in range(p, q + 1):
    f = a * x**3 + b * x**2 + c * x + d
    if f < min_f:
        min_f = f
        min_x = x
    if f > max_f:
        max_f = f
        max_x = x
print(max_f, max_x, min_f, min_x)
0