Disjoint LIS
Time limit2sMemory limit512 MB
Count the permutations of n elements that contain two disjoint increasing subsequences, each as long as the LIS, modulo 998244353.
- Level
Hard8 of 10
- Topics
- Dynamic programming, Combinatorics
- Solved
- No attempts yet
Problem
The LIS of a permutation is the length of its longest increasing subsequence.
A permutation is good if two increasing subsequences of length equal to its LIS can be found that share no elements.
Given , count the good permutations of elements. The answer may be large, so output it modulo .
Input
The first line contains one integer (): the number of elements.
Output
Output one integer: the number of good permutations of elements, modulo .