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

建议使用的浏览器:

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

7250:Even Tree Split

题目描述
You are given an undirected tree with $n$ nodes. It's guaranteed that $n$ is even.

You are going to delete some of the edges (at least $1$), and have to let each of the remaining connected components have an even number of vertices.

Calculate the number of ways to delete the edges that satisfy such constraints, modulo $998244353$.
输入解释
The first line contains an integer $T(1 \leq T \leq 30)$ - the number of test cases.

The first line of each test case contains an integer $n(1 \leq n \leq 10^5)$ - the number of vertices on the tree.

The next $n-1$ lines of each test case contain two integers $u,v(1 \leq u,v \leq n)$, representing an edge between $u$ and $v$.

It is guaranteed that the input graph is a tree with even number of vertices.
输出解释
For each test case, output the number of ways to delete the edges that satisfy such constraints in a single line, modulo $998244353$.
输入样例
2
2
1 2
4
1 2
2 3
3 4
输出样例
0
1

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

源链接: HDU-7250

最后修改于 2022-09-15T06:17:37+00:00 由爬虫自动更新

共提交 0

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