Calculating Combinations

Revision en1, by ammar_hammoud, 2023-08-04 19:23:33

Hello CF community, I'm trying to solve this problem, the problem tells me that I have to calculate

$$$C_n^r = \frac{N!}{M!\cdot (N-M)!}; 5\leq N\leq 100, M\leq N$$$

in the numerator it will always be $$$\prod _{i = N-M+1}^{n} i$$$ and in the denominator will be $$$ \prod _{i=1}^{min(N, N-M)}i$$$ as the rest will cancel out
and this is my code:

but it gives me WA, I'm not really sure why I'm getting this. Any ideas?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ammar_hammoud 2023-08-04 19:23:33 589 Initial revision (published)