아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

City United

시간 제한3초메모리 제한512 MB

요약
모든 간선이 거리 13 이내의 두 정점을 잇는 그래프에서 연결된 정점 부분집합의 개수를 2로 나눈 나머지를 구한다.
난이도

보통10점 중 7점

유형
그래프, DFS, 조합론
정답자
아직 제출이 없습니다

문제

In ICPCCamp there are nn cities which are conveniently labeled with 1,2,…,n1, 2, \dots, n. There are also mm bidirectional roads: the ii-th road connects cities a_ia\_i and b_ib\_i.

Bobo chooses a non-empty subset of cities to form a union. For each two cities aa and bb in the union, there must exist a path from aa to bb passing through no cities outside the union. In other words, the union must be connected.

Bobo would like to know how many ways there are to choose such a subset, but he is afraid of large numbers. Therefore, he just wants to find this number modulo 22.

입력

The first line contains two integers nn and mm (1≤n≤501 \leq n \leq 50, 0≤m≤n(n−1)20 \leq m \leq \frac{n(n - 1)}{2}). 

The ii-th of the following mm lines contains two integers a_ia\_i and b_ib\_i (1≤a_i,b_i≤n1 \leq a\_i, b\_i \leq n, 0<∣a_i−b_i∣≤130 < |a\_i - b\_i| \leq 13).

출력

Output an integer which denotes the number of possible subsets modulo 22.

예제2

  1. 예제 1

    입력
    3 2
    1 2
    2 3
    
    예상 출력
    0
    
  2. 예제 2

    입력
    3 3
    1 2
    2 3
    3 1
    
    예상 출력
    1