#P7487. 「Stoi2031」兰亭序
「Stoi2031」兰亭序
Description
Yue likes complex numbers very much, especially complex numbers of the form . She chooses two positive integers , and calls the absolute degree of . The product of the absolute degrees of all satisfying is called the irrelevance degree of . Now she wants you to help her compute, for each , the irrelevance degree of , denoted as . Since it is too troublesome to report too many numbers, you only need to output the result of XOR-ing all answers together.
Input Format
One line with two positive integers .
Output Format
One line with one non-negative integer representing the answer.
15 2
201012023
1 3
2
521 6
262795752
6546546546546543 22211
388124125
Hint
Brief statement of the problem:
Given , for compute
$$\prod_{x_1=1}^{n}\prod_{x_2=1}^{n}\dots\prod_{x_t=1}^{n}\left( 1+e^{\frac{2\pi ix_1x_2\dots x_t}{n}} \right) \bmod{335544323}$$Output the XOR-sum of all answers.
Here, holds for all , and is the imaginary unit, satisfying .
Sample explanation:
For the first sample, when , the answers are respectively. After taking modulo, they are , and the XOR result is .
For the second sample, when , all answers are , and the XOR result is .
Due to space limits, the remaining samples are not explained.
Constraints:
This problem uses bundled testcases. The limits and scores of each subtask are as follows:
| Subtask No. | Special constraint | Score | ||
|---|---|---|---|---|
| None | ||||
| is even | ||||
| None | ||||
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号