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:一个函数就AC

Posted by y09shendazhi at 2010-08-26 16:45:26 on Problem 1306
In Reply To:一个函数就AC Posted by:Hammer307 at 2009-05-16 22:49:55
int comb(int m,int n)
{
	if(n<m)
		return 0;
	int result=1;
	m=m<n-m?m:n-m;
	for(int i=1;i<=m;i++)
	{
		result=(result/i)*(n-m+i)+((result%i)*(n-m+i))/i;
	}
	return result;
}
INT撮撮有余

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