delete pics to save space

This commit is contained in:
2023-08-03 09:22:52 +08:00
commit de60cd6ed4
1334 changed files with 66221 additions and 0 deletions

26
1.3382.cpp Normal file
View File

@ -0,0 +1,26 @@
#include<cstdio>
#include<cmath>
const double eps=1e-7;
int n;
double L,R,M1,M2,v1,v2,a[14];
inline double cal(double x)
{
double res=0;
for(int i=0;i<=n;i++) res=res+a[i]*pow(x,i);
return res;
}
int main()
{
scanf("%d%lf%lf",&n,&L,&R);
for(int i=n;i>=0;i--) scanf("%lf",&a[i]);
while(R-L>eps)
{
M1=(R-L)/3+L; M2=(R-L)/3*2+L;
v1=cal(M1); v2=cal(M2);
if(v1>v2) R=M2;
else if(v1<v2) L=M1;
else L=M1,R=M2;
}
printf("%.5lf\n",L);
return 0;
}