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 xiaomi7732 at 2005-09-13 21:13:47 on Problem 2613
#include<iostream.h>
#include<iomanip.h>
#include<math.h>

double c(int m, int n){
	int i;
	double s=0.0;
	for(i=0;i<n;i++){
		s+=(double)log(m-i)-(double)log(n-i);
	}
	return s;
}
void main(void){
	int p,q,r,s;
	double res1,res2,res;
	while(cin>>p>>q>>r>>s){
		res1=c(p,q);
		res2=c(r,s);
		if(res1-res2>log(100000000)) continue;
		res=(double)exp(res1-res2);
		cout<<setiosflags(ios::fixed)<<setprecision(5)<<res<<endl;
	}
}

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