| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:一个函数就ACIn 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator