摘要:
用途 : 用来解决形似\(a^x\equiv c\mod P(a,c,P为常数且P为质数,a为P的原根,x为要求的数)\) 插播: \(x\)的范围为\(0\le x\le P-1\) 证明: 因为\(a\)是\(P\)的原根,所以$\left { a0,a1,\dots,a^{P-1} \righ 阅读全文
posted @ 2025-06-26 10:29
lghjl
阅读(8)
评论(0)
推荐(0)
摘要:
当需要取模的程序中有减法时,需要将答案加上模数再模一下 例如: ans = pow(2, n) % mod; ans -= (n + 1); ans = (ans + mod) % mod; P3723 给定两个长度为n的序列,可以平移(例如,a={1,2,3,4}, 平移后a={2,3,4,1}) 阅读全文
posted @ 2025-06-26 10:29
lghjl
阅读(20)
评论(0)
推荐(0)

浙公网安备 33010602011771号