当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6578:Blank

题目描述
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$.
输入解释
The first line of the input contains an integer $T(1\le T \le 15)$, denoting the number of test cases.
In each test case, there are two integers $n(1 \le n \le 100)$ and $m(0 \le m \le 100)$ in the first line, denoting the number of blanks and the number of conditions.
For the following $m$ lines, each line contains three integers $l, r$ and $x$, denoting a condition$(1 \le l \le r \le n$, $1 \le x \le 4)$.
输出解释
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$.
输入样例
2
1 0
4 1
1 3 3
输出样例
4
96
来自杭电HDUOJ的附加信息
Recommend

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6578

最后修改于 2020-10-25T23:32:29+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 262144/262144K(Java/Others)