#abc213g. G - Connectivity 2

G - Connectivity 2

Score : 600600 points

问题描述

给定一个包含 NN 个顶点和 MM 条边的简单无向图 GG。顶点编号为 1,2,,N1,2,\dots,N,边编号为 1,2,,M1,2,\dots,M,其中第 ii 条边连接顶点 aia_i 和顶点 bib_i

考虑从 GG 中移除零个或多个边以得到一个新的图 HH。我们可以得到 2M2^M 种不同的图作为 HH。在这些图中,对于每个满足 2kN2 \leq k \leq N 的整数 kk,找出顶点 11 和顶点 kk 直接或间接相连的图的数量。

由于数量可能非常大,将结果对 998244353998244353 取模后输出。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

Given is a simple undirected graph GG with NN vertices and MM edges. The vertices are numbered 1,2,,N1,2,\dots,N, the edges are numbered 1,2,,M1,2,\dots,M, and Edge ii connects Vertex aia_i and Vertex bib_i.
Consider removing zero or more edges from GG to get a new graph HH. There are 2M2^M graphs that we can get as HH. Among them, find the number of such graphs that Vertex 11 and Vertex kk are directly or indirectly connected, for each integer kk such that 2kN2 \leq k \leq N.
Since the counts may be enormous, print them modulo 998244353998244353.

Constraints

  • 2N172 \leq N \leq 17
  • 0MN(N1)20 \leq M \leq \frac{N(N-1)}{2}
  • 1ai<biN1 \leq a_i \lt b_i \leq N
  • (ai,bi)(aj,bj)(a_i, b_i) \neq (a_j, b_j) if iji \neq j.
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN MM

a1a_1 b1b_1

\vdots

aMa_M bMb_M

Output

Print N1N-1 lines. The ii-th line should contain the answer for k=i+1k = i + 1.

Sample Input 1

3 2
1 2
2 3

Sample Output 1

2
1

We can get the following graphs as HH.

  • The graph with no edges. Vertex 11 is disconnected from any other vertex.
  • The graph with only the edge connecting Vertex 11 and 22. Vertex 22 is reachable from Vertex 11.
  • The graph with only the edge connecting Vertex 22 and 33. Vertex 11 is disconnected from any other vertex.
  • The graph with both edges. Vertex 22 and 33 are reachable from Vertex 11.

Sample Input 2

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

Sample Output 2

43
31
37
41

Sample Input 3

2 0

Sample Output 3

0

update @ 2024/3/10 09:30:20