HDU - 5728 求 K=∑i=1mϕ(i∗n)mod1000000007 K = \displaystyle\sum_{i=1}^m {\phi(i*n)} mod 1000000007 其中 n n是 square-free number 求 ans=KKKK..modpans = K^{K^{K^{K^{..}}}}\mod p 先求 K K 由于 ϕ(n)\ph
Everybody loves big numbers (if you do not, you might want to stop reading at this point). There are many ways of constructing really big numbers known to humankind, for instance: Exponentiation: 4
题目链接:点我啊!!~~~ P S : PS: PS:注意要判断扩展欧拉降幂,并用快速乘 O ( s q r t ( n ) ) O(sqrt(n)) O(sqrt(n))求欧拉函数: #include<bits/stdc++.h>#define rint register int#define deb(x) cerr<<#x<<" = "<<(x)<<'\n';using nam
题目链接:点我啊╭(╯^╰)╮ 题目大意: 求 a a . . . a m o d a^{a^{...^a}} mod aa...amod m m m,共 b b b 个 a a a 解题思路: 注意对于指数取模的时候 要判断计算指数会不会超过模数 所以在快速幂里修改一下取模操作即可 P S : PS: PS: 对于 g c