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

建议使用的浏览器:

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

5871:Number of Connected Subgraph

题目描述
A cactus is a connected undirected graph in which every edge belongs to at most one simple cycle. Intuitively, cactus is a generalization of a tree where some cycles are allowed. Given an undirected graph $G(V,E)$, where $ V $ is the set of vertices and $ E $ of edges, where an edge is a set of two distinct vertices $ \{v_1,v_2\}\subseteq V $. An $induced\ subgraph$ of a graph is another graph, formed from a subset of the vertices of the graph and $all$ of the edges connecting pairs of vertices in that subset. Now, here comes the problem: How many induced subgraphs of a cactus are still cactuses?
输入解释
There are several cases, process till end of input.
  
  For each case, the first line contains an integer $ N $, the second line an integer $ M $, denoting respectively the number of vertices and edges of the given directed graph. Each of the following $ M $ lines contains two integers $ u$ and $v$, meaning there is one edge between $ u $ and $ v $.

You can assume that
    $\cdot$ the given graph is always a cactus
    $\cdot$ $ N,M\le 100000 $
输出解释
For each case output your answer mod 1000000007 on a single line.
输入样例
4
4
1 2
2 3
3 4
4 1
5
6
1 2
2 3
3 1
2 4
4 5
5 2
输出样例
13
22
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5871

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

共提交 0

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