結果

問題 No.2970 三次関数の絶対値
ユーザー zawakasu
提出日時 2024-11-29 21:29:44
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 918 ms
コンパイル使用メモリ 100,528 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-29 21:29:47
合計ジャッジ時間 2,360 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 44 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <iostream>
#include <iomanip>
#include <cassert>
int C[4];
int main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    std::cin >> C[0] >> C[1] >> C[2] >> C[3];
    int L, R;
    std::cin >> L >> R;
    double ans{(int)2e9};
    for (double i{(double)L} ; i <= R ; i += 1e-4) {
        ans = std::min(ans,
                std::abs(C[0] + C[1] * i + C[2] * i * i + C[3] * i * i * i));
    }
    std::cout << std::fixed << std::setprecision(6) << ans << '\n';
}
0