#P11957. 「ZHQOI R1」幂和
「ZHQOI R1」幂和
Description
Given integers , compute the value of the following expression:
where the result is taken modulo .
Special Note: is defined as .
Here, denotes the number of 's in the binary representation of .
Input Format
A single line containing three integers .
Output Format
Output a single integer representing the answer.
5 5 2
23
12345678 1919810 11451
69157901
999999999999 125432670 1000
154496571
Hint
Constraints
This problem uses subtask scoring.
For all test cases:
- ,
- ,
- .
| Subtask | Score | ||
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | |||
| 9 |
京公网安备 11011102002149号