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

Re:我老是TLE 哪位高手可以给我一个好的算法啊

Posted by x1e398u at 2005-12-12 13:31:34 on Problem 1942
In Reply To:我老是TLE 哪位高手可以给我一个好的算法啊 Posted by:yzu_zoufeng at 2005-12-11 17:13:02
> 我做这题老是超时
> 哪位高手可以给我一个好的算法啊
> 我的邮箱是
> licostar_109@hotmail.com
> 谢谢啦
_int64 C(unsigned int m,unsigned int n)
{
	if(n==0) return 1;
	if(n==1) return m;
	if(n>(m>>1)) return C(m,m-n);
	return C(m-1,n-1)*m/n;
}

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