ユニークビジョンプログラミングコンテスト2025 夏(AtCoder Beginner Contest 411)
G
Count Cycles
AtCoder
⌀ 2093
原题
翻译中…

Problem Statement

翻译中…

There is an undirected graph $G$ with $N$ vertices and $M$ edges. $G$ does not contain self-loops, but may contain multi-edges. Vertices are numbered from $1$ to $N$, and edges are numbered from $1$ to $M$, with edge $i$ connecting vertices $U_i,V_i$.

翻译中…

Find the number, modulo $998244353$, of cycles contained in $G$.

翻译中…

More formally, find the number, modulo $998244353$, of subsets $\lbrace e_1,e_2,\dots,e_k\rbrace \subseteq \lbrace 1,2,\dots,M\rbrace\ (k\geq 2)$ of the given edge set that satisfy the following condition.

翻译中…
  • There exists a permutation $(e_1',e_2',\dots,e_k')$ of $(e_1,e_2,\dots,e_k)$ and a vertex sequence $(v_1,v_2,\dots,v_k)$ such that all of the following hold:
  • $v_1,v_2,\dots,v_k$ are pairwise distinct;
    • For all $j\ (1\leq j\leq k)$, edge $e_j'$ connects vertices $v_j,v_{(j\bmod k) + 1}$.
翻译中…

Constraints

翻译中…
  • $2\leq N \leq 20$
  • $2\leq M \leq 2\times 10^5$
  • $1\leq U_i < V_i \leq N$
  • All input values are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N M
U_1 V_1
U_2 V_2
\vdots
U_M V_M

翻译中…

Output

翻译中…

Output the answer.

翻译中…

样例

Input #1
3 4
1 3
1 2
2 3
1 3
Output #1
3
As shown in the figure below, there are a total of $3$ cycles. The numbers inside the circles and the numbers next to the lines represent vertex numbers and edge numbers, respectively. Red lines represent edges included in cycles, and black lines represent the other edges. ![Three figures representing the graphs are arranged from left to right. Painted red are edges 1,2,3, edges 2,3,4, and edges 1,4 from left to right.](https://img.atcoder.jp/abc411/04b030a3842b2a8a0570502f1a691681.png) From left to right, these correspond to choosing edge sets $\lbrace 1,2,3 \rbrace,\lbrace 2,3,4 \rbrace,\lbrace 1,4 \rbrace$, respectively.
Input #2
4 2
1 4
2 3
Output #2
0
Input #3
5 15
1 5
3 4
2 3
2 4
3 5
4 5
2 5
2 3
1 3
4 5
2 5
4 5
1 2
3 4
1 5
Output #3
166
题目信息

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。