HDU 2199 Can You solve this equation?_ two-point search

Source: Internet
Author: User

1#include <iostream>2#include <cstdio>3#include <cmath>4 #defineSC (x) scanf ("%d",& (x))5 #definePF (x) printf ("%.4lf\n", X)6 using namespacestd;7 intT;8 DoubleY;9 DoubleRDoublex)Ten { One     return(8*pow (x,4) +7*pow (x,3) +2*pow (x,2) +3*x +6); A } - DoubleFind () - { the     DoubleFront =0, rear = -, mid; -      while((Rear-front) > 1e-6) -     { -Mid = (front + rear)/2; +         if(R (Mid) <Y) -Front = mid + 1e-7; +         Else ARear = mid-1e-7; at     } -     return(front + rear)/2; - } - intMain () - { - SC (T); in      while(t--) -     { toCIN >>Y; +         if(R (0) <= y && y <= R ( -)) - PF (Find ()); the         Else *cout <<"No solution!"<<Endl; $     }Panax Notoginseng     return 0; -}
View Code

HDU 2199 Can You solve this equation?_ two-point search

Contact Us

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.