#P10104. [GDKOI2023 提高组] 异或图
[GDKOI2023 提高组] 异或图
Problem Description
Given an undirected graph with vertices and edges, an array of length , and an integer , you need to count how many arrays of length satisfy:
- 。
- For every edge , 。
- , where denotes bitwise XOR.
Output the answer modulo 。
Input Format
The first line contains three integers 。
The second line contains integers 。
The next lines each contain two positive integers , representing an undirected edge。
Output Format
Output one integer, the answer。
3 1 2
1 2 3
1 2
4
4 6 2
7 11 14 0
1 2
1 3
2 3
2 4
4 1
4 3
44
Hint
There are four feasible arrays : 。
For all testdata, , , 。
- Subtask 1 (20pts): , 。
- Subtask 2 (50pts): 。
- Subtask 3 (10pts): 。
- Subtask 4 (20pts): No special constraints。
Translated by ChatGPT 5