QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 100

#6225. 生成树

Statistics

给定无向连通图 $G$,已知 $G$ 在删掉一条边后是一颗仙人掌(仙人掌:不存在两个拥有公共边的简单环的无向联通图),求 $G$ 的生成树个数。结果对 $998244353$ 取模。

输入格式

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

接下来 $m$ 行,每行两个用空格分隔的正整数 $u, v(1\le u, v\le n)$,表示边 $(u,v)\in G$。

输出格式

输出一行一个整数,表示图 $G$ 的生成树个数对 $998244353$ 取模的结果

样例数据

样例输入

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

样例输出

8

子任务

对于所有数据,$1\le n\le m\le 5\times 10^5$。

  • 对于 $10\%$ 的数据,$1\le n=m\le 2000$。
  • 对于另外 $40\%$ 的数据,$1\le n,m\le 10^5$ 且 $G$ 本身是仙人掌。
  • 对于余下 $50\%$ 的数据,无特殊限制。
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.