A Combinatorics Problem

Revision en2, by wtw, 2017-03-15 18:52:43

Hi,Codeforces! I need your help!

There is a kind of integer sequence of length (n+k). (k<=n)

Constraints follow:

  1. For every element in sequence, its value is either -1 or a positive integer.

  2. The number of -1's occurrences is n and the number of positive integers's occurrences is k.

  3. The sum of all positive integers equals n.

  4. Any prefix sum of the sequence is non-negative.

Now you must calculate the number of different sequences satisfying the constraints above.

Is there a general formula for this answer? Most thanks.

Tags combinatorics

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English wtw 2017-03-15 18:52:43 7 Tiny change: 'There is an integer s' -> 'There is a kind of integer s'
en1 English wtw 2017-03-15 18:51:24 584 Initial revision (published)