#P7580. 「RdOI R2」因数和(sum)
「RdOI R2」因数和(sum)
Description
As everyone knows, the standard prime factorization form of is .
Given a sequence of length .
Define $f(x)=\sum\limits_{d|x}\left({a_{\frac{x}{d}}\times\prod\limits_{i=1}^{k_d}{C_{c_{d,i}+m}^{m}}}\right)$. Now you need to compute , where is a given constant.
Since monsters does not like numbers that are too large, you need to output the answers modulo .
In addition, to avoid excessive input and output size, this problem uses a random number generator to produce the data, and you only need to output the XOR of all answers.
If you do not know what is, , where denotes factorial.
Input Format
There is one line of input.
The first line contains three non-negative integers .
You need to call the data generator (randomdigit) times in your program to obtain .
Output Format
Output one line with one integer: the XOR of all .
3 0 12345678
175092810
114514 100000 1919810
212218651
9919810 2 12121121
204065242
Hint
Data Generator
C/C++:
#define uint unsigned int
uint seed;
inline uint randomdigit(){
seed^=seed<<13;
seed^=seed>>17;
seed^=seed<<5;
return seed;
}
pascal:
var seed:dword;
function randomdigit:dword;
begin
seed:=seed xor(seed shl 13);
seed:=seed xor(seed shr 17);
seed:=seed xor(seed shl 5);
randomdigit:=seed;
end;
python3:
seed = 0 # please input seed
mod = 1 << 32
def randomdigit():
global seed
seed ^= (seed << 13) % mod
seed ^= (seed >> 17) % mod
seed ^= (seed << 5) % mod
return seed
Sample Explanation
The sequence is .
The values of modulo are , respectively.
Constraints
For of the testdata, , , and .
-
Subtask ( of the testdata): , .
In this subtask:
There is of the testdata with .
Another of the testdata satisfies .
-
Subtask (the remaining of the testdata): , .
Hint
Please pay attention to the impact of memory limits and constant factors on program running efficiency.
Translated by ChatGPT 5
京公网安备 11011102002149号