#P10674. 【MX-S1-T3】电动力学
【MX-S1-T3】电动力学
Background
Original link: https://oier.team/problems/S1C。
Problem Description
Given a simple undirected connected graph with vertices and edges, where the vertices are labeled .
You need to count how many ordered pairs of sets satisfy that for every , either is also , or there exist () such that there is a simple path from to that passes through .
Note that the set pair may be empty.
Output the answer modulo 。
Input Format
The first line contains two positive integers 。
The next lines each contain two positive integers , describing an edge in the graph. The graph is guaranteed to be connected, with no self-loops or multiple edges.
Output Format
Output one integer in a single line, representing the number of set pairs that satisfy the condition, modulo 。
2 1
1 2
9
9 10
8 3
6 8
8 5
1 6
6 2
4 6
8 2
1 7
9 6
5 3
80995
20 36
4 7
2 13
18 11
6 14
4 20
5 4
1 9
19 4
6 8
11 15
4 11
4 18
16 9
16 4
18 15
3 18
4 6
5 7
20 6
20 8
8 14
19 13
12 9
4 8
4 15
20 14
3 10
12 1
17 16
13 4
4 14
10 18
4 2
16 12
19 2
1 16
211240350
Hint
Sample Explanation 1
All valid sets are:
- 。
- 。
- 。
- 。
- 。
- 。
- 。
- 。
- 。
Constraints
This problem uses bundled subtasks.
For of the testdata, , , . The graph is guaranteed to be connected, with no self-loops or multiple edges.
| Subtask ID | Special Property | Score | ||
|---|---|---|---|---|
| None | ||||
| None | ||||
Translated by ChatGPT 5