递推
「NOI2012」随机数生成器-矩阵快速幂
· ✏️ 286 words · ☕ 1 mins read

给定正整数 n,m,a,c,X[0],g ,求按照 X[n+1]=(aX[n]+c)modm 生成出的第 nX[n]modg 的值。

数据范围: n,m,a,c,X[0]1018