#P16128. [ICPC 2018 NAIPC] Double Clique
[ICPC 2018 NAIPC] Double Clique
题目描述
You are given an undirected graph with nodes and edges. The set of vertices is and the set of edges is .
Let the Complement of be . The Complement of a graph is a graph with all of the same nodes, but if there’s no edge between nodes and in , then there is an edge between and in , and if there is an edge between and in , then there is no edge between and in .
A Clique is a subset of nodes that have an edge between every pair. A subset of nodes is called a Double Clique if forms a clique in , and forms a clique in . Note that an empty set of nodes is considered a clique.
Given a graph, count the number of double cliques in the graph modulo .
输入格式
Each input will consist of a single test case. Note that your program may be run multiple times on different inputs. Each test case will begin with a line with two integers and (), where is the number of nodes and is the number of edges in the graph. The nodes are numbered . Each of the next lines will contain two integers and (), representing an edge between nodes and . The edges are guaranteed to be unique.
输出格式
Output a single integer, which is the number of Double Cliques in the graph modulo .
3 3
1 3
1 2
2 3
4