
数论
accrazypt
这个作者很懒,什么都没留下…
展开
-
数论(欧拉降幂和质数分解数) ——杭电多校赛第九场E
数论(欧拉降幂) ——杭电多校赛第九场E 给定 a ,b ,c , d , x, y 求 0⩽a,b,c,d⩽3×106,0<x,y⩽109,a⩽b,c⩽d. 首先对问题转化为枚举质因子,计算为每个公共质因子贡献的问题。规模为O(log x + log y)乘积就转化成了和的形式只需求出此式(指数)然后快速幂即可。 这里还要用到一个原理就是指数可能会爆long long 所以就是用到一个欧拉降幂,原理我也是看不懂,但是公式记住先。在快速幂取模时指数对mod-1取余,其他还是不变对mod取余。或者这里原创 2020-08-10 16:26:15 · 228 阅读 · 0 评论 -
环+逆——牛客多校赛第二场J题
环+逆元 ——牛客多校赛第二场J题 Given a permutation with size n and an integerk, you should find a permutation substitutionP that{1,2,⋯,n} will become {A}A after performing substitution P for exactly k times. Print the permutation after performing P for once on{1,2,⋯,n}原创 2020-07-15 13:49:06 · 328 阅读 · 0 评论 -
数论——Dead Fraction(POJ - 1930 )
数论 ——Dead Fraction(POJ - 1930 ) Mike is frantically scrambling to finish his thesis at the last minute. He needs to assemble all his research notes into vaguely coherent form in the next 3 days. Unfortunately, he notices that he had been extremely sloppy i原创 2020-05-21 16:00:14 · 205 阅读 · 0 评论