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; }
三分模板,布布扣,bubuko.com
三分模板
原文:http://www.cnblogs.com/shangyu/p/3770509.html