double solve()
{
double M,RM;
double L = 0.0;
double R = INF;
while (L + eps < R)
{
M = (L + R) / 2;
RM = (M + R) / 2;
if (calc(M) < calc(RM))
R = RM;
else
L = M;
}
return R;
}
三分模板
时间: 2024-10-21 22:39:33
double solve()
{
double M,RM;
double L = 0.0;
double R = INF;
while (L + eps < R)
{
M = (L + R) / 2;
RM = (M + R) / 2;
if (calc(M) < calc(RM))
R = RM;
else
L = M;
}
return R;
}
三分模板