#A. 加边

    Type: Default File IO: addedge 1000ms 512MiB

加边

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

加边(addedge\texttt{addedge}

【题目描述】

小 D 有一棵树。

他觉得树不够优美,于是他在树上不停地加边,得到了一棵仙人掌(每条边至多在一个环上的图)。

但他认为仙人掌也不够优美,于是他又在仙人掌上加了一条边,这次他很满意,但他找不出原来的树是哪棵了。

请你帮帮小 D,求出有原始的树有多少种可能的情况,由于答案很大,小 D 只需要你告诉他答案对 109+710^9+7 取模后的结果。

重边算不同的边。

【输入格式】

addedge.in\texttt{addedge.in} 中读入数据。

第一行两个整数 n,mn,m,表示图的点数和边数。

接下来 mm 行,每行两个整数 u,vu,v,表示最终的图中一条连接 u,vu,v 的边。

【输出格式】

输出到 addedge.out\texttt{addedge.out} 中。

一行一个整数,表示初始树的数量对 109+710^9+7 取模后的结果。

【样例 1 输入】

4 5
1 2
1 3
2 3
2 4
3 4

【样例 1 输出】

8

【数据范围】

对于所有测试数据:1nm5×1051\le n\le m\le 5\times 10^5,保证图符合题目描述。

NOIP 题目选讲(二)

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2023-12-1 0:00
End at
2023-12-8 0:00
Duration
168 hour(s)
Host
Partic.
22