| ||||||||||
| 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 | |||||||||
哎,精度太怪异了.....#include<iostream>
#include<math.h>
using namespace std;
int main()
{
double l,l1,d,u,h,c,t,ang,d_u;
while(cin>>l>>t>>c)
{
if(l<0)
break;
if(fabs(l)<0.000000000001)
{
printf("0.000\n");
continue;
}
l1=l+c*t*l;
d=0;
u=2.5;
while(fabs(d-u)>0.000000000001){
ang=(d+u)/2;
d_u=sin(ang)/ang;
if(l1*d_u<=l) //此处<=就accept,<就wrong answer
u=ang;
else d=ang;
}
h=l*tan(ang/2)/2;
printf("%.3lf\n",h);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator