#P7513. 「Stoi2031」兰亭序 加强版

    ID: 8321 远端评测题 3000ms 128MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>数学递推递归O2优化素数判断,质数,筛法快速傅里叶变换 FFT快速数论变换 NTT

「Stoi2031」兰亭序 加强版

Background

This problem is an enhanced version of "Stoi2031" Lantingxu.

Problem Description

Given n=abn=a^b and kk, for each 1tk1 \le t \le k, 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 bitwise XOR of all kk answers.

Here, eit=cost+isinte^{it}=\cos{t}+i\sin{t} holds for all tRt \in \mathbb{R}. ii is the imaginary unit, satisfying i2=1i^2=-1.

Input Format

One line with three positive integers a,b,ka,b,k, where n=abn=a^b.

Output Format

One line with one non-negative integer representing the answer.

15 1 2

201012023

1 7 3

2

3 2 3

301162058

4 2 2

0

19260817 114514 13579

461194421

Hint

Constraints: For all testdata, 1a10181 \le a \le 10^{18}, 1b10131 \le b \le 10^{13}, 1k1051 \le k \le 10^5.

Translated by ChatGPT 5