#P7717. 「EZEC-10」序列
「EZEC-10」序列
Background
Accurate analytic characterization should be the first breakthrough to try.
— command_block, "Pre-exam Tips"
Problem Description
How many different sequences are there that satisfy:
- The length of is .
- All elements in are non-negative integers not greater than .
- There are constraints of the form with . Each constraint means ( denotes the bitwise XOR operation).
Two sequences are the same if and only if all their elements are the same.
Please output the result modulo .
Input Format
The input has lines:
- The first line contains three integers .
- The next lines each contain three integers .
Output Format
Output one line containing the result modulo .
3 1 2
1 2 1
6
5 1 12
1 2 3
26364
Hint
[Sample Explanation]
There are sequences: $\{0,1,0\},\{0,1,1\},\{0,1,2\},\{1,0,0\},\{1,0,1\},\{1,0,2\}$.
[Data Scale and Conventions]
This problem uses bundled testdata.
- Subtask 1 (1 point): .
- Subtask 2 (5 points): .
- Subtask 3 (15 points): .
- Subtask 4 (10 points): .
- Subtask 5 (20 points): .
- Subtask 6 (2 points): testdata is random.
- Subtask 7 (47 points): no special constraints.
For of the testdata: , , , , .
[Hint]
If you do not know what XOR is, please click here。
Translated by ChatGPT 5