#P2025. Dirichlet 半在线卷积
Dirichlet 半在线卷积
Description
Given a function satisfying , and
Given a positive integer , compute the values . To control the output size, you only need to output the value of the following expression:
Here denotes xor.
Input Format
One line with a positive integer .
Output Format
One line with a non-negative integer, representing the value of .
10
10
1000000
3527171714
10000000
191685100
Hint
For all testdata, .
For Sample 1, the first terms of are: .
The time limit is times that of std.
Translated by ChatGPT 5
京公网安备 11011102002149号