| ||||||||||
| 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 | |||||||||
坑爹到精度问题//By Lin
AC的方法
while ( fabs(g-h)>1e-2 )
{
mid = (g+h)/2;
if ( pan(mid) ){
g = mid;
}else h = mid;
}
printf("%.0f\n" , mid );
WA的方法
while ( fabs(g-h)>1e-2 )
{
mid = (g+h)/2;
if ( pan(mid) ){
g = mid;
ans = mid;
}else h = mid;
}
printf("%.0f\n" , ans );
明显第二个比第一个更接近精确值,但是确实WA。。。
强烈认为这些问题要special judge。。。不然比标程精确你就哭把
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator