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

FOXLIU的好方法,让我过了

Posted by fisheatscats at 2008-12-14 13:26:35 on Problem 1423
#include <iostream>
#include <math.h>

using namespace std;

const double e= 2.718281828459 ;
const double pi= 3.1415926535898 ;

int main()
{
	long long n,tt;
	cin>>tt;
	while (tt>0)
	{
		tt--;
		cin>>n;
		long long ans = (long long)((double)log10(sqrt(2 * pi * n)) + n * log10(n / e))+1;
		cout<<ans<<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