Hi,Codeforces! I need your help!↵
↵
↵
There is an 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.↵
↵
↵
↵
There is a
↵
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.↵
↵