#P6034. Ryoku 与最初之人笔记
Ryoku 与最初之人笔记
Description
Ryoku retold the problem to you: compute:
$$\sum_{a = 0}^n \sum_{b = a + 1}^n [a\equiv b\pmod {a \text{ xor } b}]$$That is, count the number of ordered pairs such that , where are non-negative integers not greater than , and .
Input Format
The input contains one integer .
Output Format
Output one integer, the value of the expression above, modulo .
2
2
42
274
Hint
[Sample 1 Explanation]
The pairs that satisfy the condition are: .
[Constraints]
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号