QOJ.ac

QOJ

时间限制: 1 s 内存限制: 512 MB 总分: 100

#7395. Randomized Algorithms

统计

We know that finding the maximum independent set of an arbitrary graph is an NP-complete problem. Currently, there is no known exact polynomial-time algorithm, but there are many approximation algorithms with polynomial complexity.

For example, an algorithm often used by Little C is:

  1. For an undirected graph with $n$ vertices, first choose a random permutation $p[1\ldots n]$ of $1\ldots n$ with equal probability.
  2. Maintain an answer set $S$, which is initially empty. Then, in the order $i=1\ldots n$, check if $\{p[i]\}\cup S$ is an independent set. If it is, set $S=\{p[i]\}\cup S$.
  3. Finally, obtain an independent set $S$ as the answer.

Little C now wants to know the probability that this algorithm finds the maximum independent set for a given graph. Output the answer modulo $998244353$.

Input

The first line contains two non-negative integers $n$ and $m$, representing the number of vertices and edges in the given graph.

The next $m$ lines each contain two positive integers $(u,v)$ ($u\neq v$), describing an undirected edge in the graph.

Output

Output the probability, with the answer modulo $998244353$.

Examples

Input 1

3 2
1 2
2 3

Output 1

665496236

Note 1

665496236

Subtasks

For $10\%$ of the data, $1\leq n\leq 9$.

For $30\%$ of the data, $1\leq n\leq 13$.

For $50\%$ of the data, $1\leq n\leq 17$.

Another $10\%$ of the data satisfies the condition that the given graph is a chain.

Another $10\%$ of the data satisfies the condition that the given graph is a tree.

For $100\%$ of the data, $1\leq n\leq 20, 0\leq m\leq \frac{n\times (n-1)}{2}$. It is guaranteed that the given graph has no multiple edges or self-loops.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.