Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

求助求助! 测试数据已过 为什么总是WA

Posted by 201150080226 at 2012-03-15 20:26:26 on Problem 1905
a是弧对应的圆心角的一半。

#include<stdio.h>
#include<math.h>
const double PI=acos(-1.0);
int main()
{
	//freopen("1.txt","r",stdin);
	double s,max,min,mid,l,L,a,n,c;
	while(scanf("%lf%lf%lf",&l,&n,&c)!=EOF&&(l!=-1||n!=-1||c!=-1))
	{
		L=(1+n*c)*l;
		max=PI/2,min=0;
		double temp;
		if(l==0) s=0;
		else
		{
		   do
		   {
		    	mid=(max+min)/2;
		    	temp=sin(mid)/mid;
		    	if(temp>l/L) min=mid;
		    	else max=mid;
		   }while(fabs(temp-l/L)>1e-12);
	    	double r=L/2/mid;
	    	s=r-r*cos(mid);
		}
		printf("%.3lf\n",s);
	}
	return 0;
}


Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator