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

CE!!!是肿么回事?求大神解答~~说是log(n)not match

Posted by D1030561310 at 2013-03-21 20:57:32 on Problem 1423
#include<iostream>
#include<cmath>
using namespace std;
const double e=exp(double(1));
const double PI=acos(double(-1));

double stirling(int n)
{
	//return (n*log(n/e)+log(sqrt(2*pi*n)))/log10;
	return (n*log(n)-1+log(sqrt(2*PI*n)))/log(10.0);
	//return (n*log(n)-1+0.5*log(2*PI*n))/log(10);
}
int main()
{
	/*const double e=exp(double(1));
	const double PI=acos(double(-1));*/
	int testcase,num,weishu=0;
	cin>>testcase;
	while(testcase--)
	{
		cin>>num;
		/*if(num==1) weishu=1;
		else
		{
			weishu=(int)stirling(num)+1;
		}*/
		weishu=(int)stirling(num)+1;
		cout<<weishu<<endl;
	}
	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