提交时间:2024-01-09 21:21:51
运行 ID: 36175
#include<iostream> #include<algorithm> #include<cmath> using namespace std; double c(double a) { return a*a*a*a*a-15*a*a*a*a+85*a*a*a-225*a*a+274*a-121; } double p(double a){ if(a<0) return -a; return a; } int main() { double l=1.5,r=2.4; while(r-l>1e-7){ double mid=(l+r)/2.0; if(c(mid)>0) l=mid; else r=mid; } printf("%.6lf\n",l); return 0; }