Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
直接二分结果,精度很高,1e-4可过,1e-3未试。直接二分结果,精度很高,1e-4可过,1e-3未试。 核心代码: bool can(double D) { double R = (sqr(L)/4 + sqr(D)) / (2*D); double sita = asin(L/2 / R) * 2; double Len = 2 * sita * R * 0.5; if (cmp(Len - Length)<=0) return true; return false; } while (High-Low >1e-4) { double Mid = (Low + High)/2; if (can(Mid)) Low = Mid; else High = Mid; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator