Compute "distribute n candies to to r people"

Revision en1, by gotop, 2017-07-07 07:09:08

If we can give zero candy to person, is there any way to compute Fast "distribute n candies to r people" ??

if we can't give zero candy, solution is (n-1)C(r-1)

but we can give zero candy, I don't know how to compute fast

please help me

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English gotop 2017-07-07 07:09:08 299 Initial revision (published)