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

HELP!为什么官方测试数据过了。。。还是wa.请大牛们帮我看看。。先感谢一下!!!

Posted by 3070602033 at 2009-07-04 19:54:32 on Problem 1905 and last updated at 2009-07-04 19:54:49
#include<iostream>
#include <cstdio>
#include<iomanip>
#include<cmath>
#define PI 3.1415926535897932384626433832795028

using namespace std;
int main()
{
//freopen("ans.txt","w",stdout);
//freopen("1.dat","r",stdin);
double l1,c,n,l,ang0(0),ang1,biang,tmp,ang,R,h;
while(cin>>l1&&l1>=0)
{
	cin>>n>>c;
 if(n==0.00||c==0.00||l1==0.00) 
        { 
            printf("%.3f\n",0); 
            continue; 
        }  

	l=(1+n*c)*l1;
	ang0=0;
	ang1=6*PI/7;
	ang=ang1;
 	tmp=l1/l;
while(abs(ang1-ang0)>0.00000000000001)
{
	ang=(ang0+ang1)/2;
	biang=sin(ang)/ang;
	if(biang>tmp)ang0=ang;
	else ang1=ang;
}

 printf("%.3f\n",l/ang*0.5*(1-cos(ang)));   

 }
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