Rikka with Game Theory

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Game theory is an interesting subject in computer science.

SG function is an important concept in game theory. Given a directed acyclic graph G_1G\_1 with vertex set V_1V\_1 and directed edge set E_1E\_1, for each vertex uV_1u \in V\_1, its SG function sg(u)sg(u) is defined as: sg(u)=mex(sg(v)(u,v)E_1)sg(u) = \text{mex}(\\{sg(v)| (u,v) \in E\_1\\}) where given a set SS of non-negative integers, mex(S)\text{mex}(S) is defined as the smallest non-negative integer which is not in SS.

Today, Rikka wants to generalize SG function to undirected graphs. Given an undirected graph GG with vertex set VV and undirected edge set EE, a function ff over VV is a valid SG function on GG if and only if:

  • For each vertex uVu \in V, f(u)f(u) is a non-negative integer;
  • For each vertex uVu \in V, f(u)=mex(f(v)(u,v)E)f(u) = \text{mex}(\\{f(v) | (u,v) \in E\\}).

Under this definition, there may be many valid SG functions for a graph. Therefore, Rikka wants to further figure out whether there is a connection between these valid SG functions. As the first step, your task is to calculate the number of valid SG functions for a given undirected graph GG.

입력

The first line contains two integers n,m (1n17,0mn(n1)2)n,m\ (1 \leq n \leq 17, 0 \leq m \leq \frac{n(n-1)}{2}), representing the number of vertices and edges in the graph.

Then mm lines follow. Each line contains two integers u_i,v_i (1u_i,v_in)u\_i,v\_i\ (1 \leq u\_i, v\_i \leq n), representing an edge in the graph.

The input guarantees that there are no self-loops and duplicate edges in the graph.

출력

Output a single line with a single integer, representing the number of valid SG functions.

힌트

For simplicity, we use list \[f(1),,f(n)]\[f(1), \dots, f(n)] to represent a function ff

For the sample input, there are 66 valid SG functions:

  • \[0,1,0,1,0]\[0,1,0,1,0], \[0,1,2,0,1]\[0,1,2,0,1], \[0,2,1,0,1]\[0,2,1,0,1], \[1,0,1,0,1]\[1,0,1,0,1], \[1,0,1,2,0]\[1,0,1,2,0] and \[1,0,2,1,0]\[1,0,2,1,0].