#P1722. 矩阵 II
矩阵 II
Description
If you are reading this in a rush, please jump to the sixth line.
As is well known, in ancient Chinese counting rods, red means positive and black means negative.
Given a matrix (usqwedf: isn't this just a sequence of length ?), you may freely place red and black counting rods so that the matrix is balanced (i.e., for all , in positions to , the number of red rods is greater than or equal to the number of black rods).
How many placements satisfy the balance condition (note that the numbers of red and black rods must be equal)?
Input Format
A positive integer .
Output Format
The value of modulo , where is the number of valid placements.
2
2
Hint
Sample explanation:
- Scheme 1: Red, Black, Red, Black.
- Scheme 2: Red, Red, Black, Black.
Constraints:
.
Translated by ChatGPT 5
京公网安备 11011102002149号