Splits

시간 제한5초메모리 제한2048 MB

요약
길이 n인 순열 p의 split 집합이 주어진 m개의 순열을 모두 포함하는 p의 개수를 998244353으로 나눈 나머지를 구한다.
난이도

어려움10점 중 8점

유형
조합론, 동적 계획법, 누적 합, 수학
정답자
아직 제출이 없습니다

문제

For a permutation p=p\[0]p\[1]p\[2]…p\[n−1]p = p\[0] p\[1] p\[2] \dots p\[n − 1] of the numbers 1,2,3,…,n1, 2, 3,\dots,n we define a split as a permutation qq which can be obtained by the following process:

  1. Select two sets of numbers A=i_1,i_2,…,i_kA = \\{ i\_1 ,i\_2 , \dots , i\_k \\} and B=j_1,j_2,…,j_lB = \\{ j\_1 , j\_2 ,\dots , j\_l \\} such that A∩B=∅A ∩ B = ∅, A∪B=0,1,2,…,n−1A ∪ B = \\{ 0, 1, 2, \dots ,n − 1 \\}, i_1<i_2<⋯<i_ki\_1 < i\_2 < \dots < i\_k and j_1<j_2<⋯<j_lj\_1 < j\_2 < \dots < j\_l.
  2. The permutation qq will be q=p\[i_1]p\[i_2]…p\[i_k]p\[j_1]p\[j_2]…p\[j_l]q = p\[i\_1 ]p\[i\_2 ]\dots p\[i\_k ]p\[j\_1 ]p\[j\_2 ]\dots p\[j\_l ]

Moreover, we define S(p)S(p) to be the set of all splits of a permutation pp.

You are given a number nn and a set TT of mm permutations of length nn. Count how many permutations pp of length nn exist such that T⊆S(p)T ⊆ S(p). Since this number can be large, find it modulo 998,244,353998\\, 244\\, 353.

제한

  • 1≤n≤3001 ≤ n ≤ 300
  • 1≤m≤3001 ≤ m ≤ 300

예제

이 문제는 공개된 예제가 없습니다.