QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 1024 MB Points totaux : 100 Hackable ✓

#18895. Cactus Determinant

Statistiques

A Cactus graph is a simple connected undirected graph where each edge lies in at most one simple cycle.

An adjacency matrix of a $N$-vertex graph is a $N\times N$ integer matrix, where $A_{i, j}$ is $1$ if there exists an edge connecting vertex $i$ and $j$, and $0$ otherwise.

The Determinant of a $N\times N$ matrix is defined as $\sum_{p \in P(N)}{(-1)^{inv(p)}(\prod_{i=1}^{n}{A_{i, p_i}})}$ , where $P(N)$ is the set of all permutations of size-$N$, and $inv(p)$ is the number of pairs $1 \le i < j \le N$ such that $p_i > p_j$.

993244853 is a prime number that looks like $998244353 = 119 \times 2^{23} + 1$, but is actually not.

This problem asks you to calculate the determinant of an adjacency matrix of given cactus graph mod $993244853$.

Input

The first line contains $N, M$, denoting the number of vertices and edges of the cactus graph. ($1 \le N \le 50000, 0 \le M \le 250000$)

In the next $M$ lines, two distinct integers $s, e$ denoting each endpoint of the edges are given. ($1 \le s, e \le N, s \neq e$).

It is guaranteed that the graph is connected, it does not contain loops or multiple edges, and every edge belongs to at most one simple cycle.

Output

Print the determinant of an adjacency matrix of given cactus graph mod 993244853.

Examples

Input 1

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

Output 1

993244852

Input 2

1 0

Output 2

0

Input 3

10 11
1 2
3 4
1 3
5 6
7 8
9 10
7 9
6 8
1 9
10 5
4 9

Output 3

993244849

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.