QOJ.ac

QOJ

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

#13241. Graph

Statistics

You are given an undirected graph with $n$ vertices and $m$ edges. You want to choose a non-empty subset of vertices such that the subgraph induced by this subset (containing only the chosen vertices and the edges whose both endpoints are in the subset) is connected. You want to know how many such subsets exist.

Since the problem setter is not malicious, the answer is not taken modulo $998244353$, but rather modulo $2$.

Input

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

The next $m$ lines each contain two positive integers $a_i, b_i$, representing an edge.

Output

Output a single integer representing the answer.

Examples

Input 1

3 2
1 2
2 3

Output 1

0

Note

The answer before taking the modulo is $6$. The chosen subsets are $\{1\}, \{2\}, \{3\}, \{1,2\}, \{2,3\}, \{1,2,3\}$.

Subtasks

Subtask 1 (30%): $1 \le n \le 18$;

Subtask 2 (30%): $1 \le |a_i - b_i| \le 7$;

Subtask 3 (40%): No special restrictions.

For 100% of the data, $1 \le n \le 50$, $0 \le m \le \frac{n(n-1)}{2}$, $1 \le |a_i - b_i| \le 12$.

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

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.