#P11571. 「chaynOI R1 T4」橙红色的鱼
「chaynOI R1 T4」橙红色的鱼
Background

Problem Description
Given , ask how many pairs of positive integers satisfy:
-
.
-
.
-
.
Here, denotes the number of 's in the binary representation of , and denotes the XOR operation.
For convenience, is given in binary.
It is guaranteed that none of the given numbers has leading .
Output the answer modulo .
Input Format
One line with three integers .
Output Format
One line with one integer, the answer modulo .
111 1 2
6
Hint
Sample Explanation:
All numbers below are in decimal.
When , there are six pairs: .
Constraints:
Let be the length of the given .
For of the data, .
This problem uses bundled testdata.
- Subtask 1 (15 pts): .
- Subtask 2 (25 pts): .
- Subtask 3 (25 pts): .
- Subtask 4 (35 pts): no special constraints.
Translated by ChatGPT 5