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

终于AC了 本来是前2样例对的但是第3个错了 后来发现果然是精度问题 然后参考了别人的代码用了求根公式就对了

Posted by Ink213 at 2012-12-18 11:54:48 on Problem 2006
#include<stdio.h>
#include<math.h>
int main(){
    double x,y,ka,c,m,n;
    while(scanf("%lf%lf%lf%lf",&ka,&c,&m,&n)!=EOF){
    if(ka==0&&c==0&&m==0&&n==0) break;
    x=sqrt(ka*ka+4*m*n*c*ka);
    y=(-ka+x)/(2*m*n);
    printf("%.3lf\n",-log10(y*m));
    }
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