n choose k Function

Правка en1, от FluffyPotato, 2019-06-29 04:06:10

Hello world! There is a choose function in math like "A choose B" notated sometimes like aCb I'm wondering if you can calculate this in O(1) in a program. Given two a and b, calculate a choose b.

You can definitely precompute many values, in an O(ab) loop keeping the factorials, but Can you do it without precomputation? However, precomputing also risks long long overflow. (usually choosing is much lower then the direct factorial value) Thank you

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский FluffyPotato 2019-06-29 04:06:10 475 Initial revision (published)