#P8941. [DTOI 2023] D. Goodbye 2022
[DTOI 2023] D. Goodbye 2022
Background
I announce with fireworks, say goodbye with a wave, and give thanks with a bow. Everything in the past is already past. From now on, I will walk the road ahead in a relaxed way, in a happy way. My steps are like time that never stops. Next year, we will meet again.
Problem Description
This problem background has nothing to do with luanmenglei.
Given , find how many ordered -tuples satisfy:
- , .
- , .
- , .
Output the answer modulo .
- denotes the number of bits in the binary representation of .
- denotes the bitwise XOR operation.
- Two ordered -tuples and are different if and only if there exists such that .
Input Format
One line with three positive integers .
Output Format
One line with one integer, representing the answer.
5 1 2
8
6 1 3
12
7 1 4
48
8 3 5
6
9 2 5
72
114 3 3
106624
514 3 4
296097032
1000 7 5
569405945
1000 7 1
1000
Hint
For all testdata, it is guaranteed that , , and .
The specific limits for each test point are shown in the table below:
| Test Point ID | ||
|---|---|---|
Translated by ChatGPT 5