1 条题解

  • 0
    @ 2022-11-22 21:00:49
    #include <bits/stdc++.h>
    using namespace std;
    double f(double x)
    {
        return 114 * x * x - 514 * x;
    }
    int main()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
        const double eps = 1e-12;
        double l = 0;
        double r = 20;
        while (r - l > eps)
        {
            double L = (l + r) / 2;
            double R = (L + r) / 2;
            if (f(L) < f(R))
                r = R;
            else
                l = L;
        }
        cout << fixed << setprecision(10) << f(l);
        return 0;
    }
    
    • 1

    信息

    ID
    1178
    时间
    1000ms
    内存
    256MiB
    难度
    5
    标签
    递交数
    79
    已通过
    31
    上传者