Is There a Fast Way to Compute This Combinatoric Quantity?

Правка en2, от amr0, 2019-09-21 20:06:02

Hello Codeforcians!

I would like to know if there is an efficient method to calculate

$$$ \sum_{k_A+k_B+k_O+k_R=k}{N\choose A+k_A,B+k_B,O+k_O,R+k_R} $$$

where $$$k = N-(A+B+O+R)$$$ (of course all k's are greater than or equal zero), the output is modulo $$$1'000'000'007$$$, and $$$0\leq A,B,O,R, N\leq 400,000$$$. The time limit was 2 seconds, however any suggestions are more than welcome.

Thank you!

Теги #combinatorics

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский amr0 2019-09-21 20:09:33 0 (published)
en2 Английский amr0 2019-09-21 20:06:02 9 Tiny change: 'ater than zero), th' -> 'ater than or equal zero), th' (saved to drafts)
en1 Английский amr0 2019-09-21 20:05:29 449 Initial revision (published)