Question
D. A Simple Task
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Given a simple graph, output the number of simple cycles in it. A simple cycle is a cycle with no repeated vertices or edges.
Input
The first line of input contains two integersn andm (1≤n≤19,0≤m) – respectively the number of vertices and edges of the graph. Each of the subsequentm lines contains two integersa andb, (1≤a,b≤n,a≠b) indicating that verticesa andb are connected by an undirected edge. There is no more than one edge connecting any pair of vertices.
Output
Output the number of cycles in the given graph.
Sample test(s)
input
Note
The example graph is a clique and contains four cycles of length 3 and three cycles of length 4.
求简单无向图中环的个数?简单无向图即 无自环,无重边的无向图。
这个是NP问题; codeforces 上有一题用的是状态压缩写的。
dp[s][i] s集合里最小的点到其他点的路径数;
dp[s][i] += dp[s^(1