Problem A. Blank
时间限制 2 ms
内存限制 256 MB
There are $N$ blanks arranged in a row. The blanks are numbered $ 1, 2, \ldots , N $ from left to right.
Tom is filling each blank with one number in $\{0, 1, 2, 3\}$. According to his thought, the following $M$ conditions must all be satisfied. The $i_{th}$ condition is:
There are exactly $x_i$ different numbers among blanks $\in [l_i,r_i]$.
In how many ways can the blanks be filled to satisfy all the conditions? Find the answer modulo $998244353$.
输入数据
输出数据
For each testcase, output a single line containing an integer, denoting the number of ways to paint the blanks satisfying all the conditions modulo $998244353$.
样例输入
样例输出
$ Mathjax font initiator $