結果
問題 | No.2970 三次関数の絶対値 |
ユーザー |
![]() |
提出日時 | 2024-11-30 08:39:50 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 83 ms / 2,000 ms |
コード長 | 657 bytes |
コンパイル時間 | 2,881 ms |
コンパイル使用メモリ | 243,208 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 08:39:56 |
合計ジャッジ時間 | 5,046 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
ソースコード
#include <bits/stdc++.h>#define For(i, a, b) for(int i = a; i < b; i++)#define rep(i, n) For(i, 0, n)#define rFor(i, a, b) for(int i = a; i >= b; i--)#define ALL(v) (v).begin(), (v).end()#define rALL(v) (v).rbegin(), (v).rend()using namespace std;using lint = long long;using ld = long double;int INF = 2000000000;lint LINF = 1000000000000000000;int main() {ld c0, c1, c2, c3, l, r;cin >> c0 >> c1 >> c2 >> c3 >> l >> r;ld ans = INF;for (ld x = l; x <= r; x += 0.000001) {ld y = abs(c0 + c1 * x + c2 * x * x + c3 * x * x * x);ans = min(ans, y);}cout << fixed << setprecision(6) << ans << endl;}