#P11075. 不等关系 加强版
不等关系 加强版
Background
This problem is an enhanced version of Inequality Relations. It is recommended that you solve the original problem before challenging this enhanced version.
Problem Description
Given a string consisting only of the two characters < and >.
Let be the number of permutations such that if and only if is <.
Now, please compute the sum of over all strings of length .
Since the answer may be large, you only need to output the result modulo .
Input Format
One line containing a positive integer .
Output Format
One line containing an integer, representing the number of permutations satisfying the requirement modulo .
1
2
Hint
Sample Explanation
For the string <, there is exactly one permutation that satisfies the requirement, so .
For the string >, there is exactly one permutation that satisfies the requirement, so .
Therefore, the answer is .
Constraints
| Test Point ID | |
|---|---|
For all testdata, it is guaranteed that .
Translated by ChatGPT 5