# Three points hdoj 3714 Error Curves

Source: Internet
Author: User

Topic Portal

`1 /*2 Three points: concave (convex) function to find the Extremum3 */4#include <cstdio>5#include <algorithm>6#include <cstring>7#include <cmath>8 using namespacestd;9 Ten Const intMAXN = 1e4 +Ten; One Const intINF =0x3f3f3f3f; A Const DoubleEPS =0.0000000001; - structF { -     DoubleA, B, C; the }F[MAXN]; - intN; -  - DoubleCalDoublex) { +     Doubleres =-INF; -      for(intI=1; i<=n; ++i) { +res = max (res, F[I].A * x * x + f[i].b * x +f[i].c); A     } at     returnRes; - } -  - intMainvoid)  {//hdoj 3714 Error Curves -     //freopen ("hdoj_3714.in", "R", stdin); -  in     intT scanf ("%d", &T); -      while(t--) { toscanf ("%d", &n); +          for(intI=1; i<=n; ++i) { -scanf ("%LF%LF%LF", &AMP;F[I].A, &f[i].b, &f[i].c); the         } *  \$         DoubleL =0.0, r =1000.0;Panax Notoginseng          for(intI=1; i<= -; ++i) { -             DoubleMid = (L + r)/2; the             DoubleRmid = (mid + R)/2; +             if(Cal (Mid) < cal (Rmid)) R =Rmid; A             ElseL =mid; the         } +printf ("%.4f\n", Cal (R)); -     } \$  \$     return 0; -}`

Three points hdoj 3714 Error Curves

Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.