|
|
Can anybody tell me how to calucate bynomial coefficients with a help of the fastest method? What about C(n,k) = n!/k!*(n-k)! ,where '!' denotes factorial. fastest method С[n][k]=C[n-1][k]+C[n-1][k-1] also: C(n,k)=(C(n,k-1)*(n-k+1)*Inv(k,p))%p because 100000007 is prime PS. And this method helped to Ac. Edited by author 03.11.2009 15:23 Oh! Thanks! It's cool formula :) Edited by author 29.06.2011 22:31 |
|
|