Logo
(追記) (追記ここまで)

18758번 - Fast as Ryser 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 512 MB94382343.396%

문제

After reading the paper Counting Perfect Matchings as Fast as Ryser, you learned how to count the number of perfect matchings in a general graph in O(2nn2). So you decided to write this problem to encourage people to read the paper and learn new technology.

You are given an undirected graph with n vertices and m edges, and also a constant c. We define the weight of an edge set S as follows:

  • If there are two edges in set S sharing common vertices, the weight is 0.
  • Otherwise, the weight is c|S|. Note that the weight of an empty set is 1.

Compute the sum of the weight of all subsets of edges. The answer can be large, so output it modulo 109 + 7.

입력

The first line contains three integers n, m, c (1 ≤ n ≤ 36, 0 ≤ m ≤ n(n−1)/2, 1 ≤ c ≤ 109 + 6).

Each line of the following m lines contains two integers u, v (1 ≤ u, v ≤ n, u ≠ v) indicating an undirected edge (u, v) in the graph. All edges are distinct.

출력

Output one integer: the answer.

제한

예제 입력 1

6 10 100
3 6
1 3
2 4
3 4
4 6
1 2
4 5
2 3
1 4
3 5

예제 출력 1

2171001

예제 입력 2

8 11 818466928
6 7
3 6
6 5
7 3
6 2
8 1
1 7
4 3
5 1
6 1
6 4

예제 출력 2

425176360

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2020 > Day 9: Yuhao Du Contest 7 F번

Contest > Open Cup > 2019/2020 Season > Stage 12: Grand Prix of Zhejiang F번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /