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

建议使用的浏览器:

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

6321:Problem C. Dynamic Graph Matching

题目描述
In the mathematical discipline of graph theory, a matching in a graph is a set of edges without common vertices.
You are given an undirected graph with $n$ vertices, labeled by $1,2,...,n$. Initially the graph has no edges.
There are $2$ kinds of operations :
+ u v, add an edge $(u,v)$ into the graph, multiple edges between same pair of vertices are allowed.
- u v, remove an edge $(u,v)$, it is guaranteed that there are at least one such edge in the graph.
Your task is to compute the number of matchings with exactly $k$ edges after each operation for $k=1,2,3,...,\frac{n}{2}$. Note that multiple edges between same pair of vertices are considered different.
输入解释
The first line of the input contains an integer $T(1\leq T\leq10)$, denoting the number of test cases.
In each test case, there are $2$ integers $n,m(2\leq n\leq 10,n \bmod 2=0,1\leq m\leq 30000)$, denoting the number of vertices and operations.
For the next $m$ lines, each line describes an operation, and it is guaranteed that $1\leq u<v\leq n$.
输出解释
For each operation, print a single line containing $\frac{n}{2}$ integers, denoting the answer for $k=1,2,3,...,\frac{n}{2}$. Since the answer may be very large, please print the answer modulo $10^9+7$.
输入样例
1		
4 8	
+ 1 2
+ 3 4
+ 1 3
+ 2 4
- 1 2
- 3 4
+ 1 2
+ 3 4
输出样例
1 0
2 1
3 1
4 2
3 1
2 1
3 1
4 2
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6321

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

共提交 0

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