AtCoder Beginner Contest 162 E Sum of gcd of Tuples (Hard) 莫比乌斯反演
【推荐阅读】微服务还能火多久?>>> AtCoder Beginner Contest 162 比赛人数10673 快,比赛开始后5分钟看到所有题 AtCoder Beginner Contest 162 E Sum of gcd of Tuples (Hard) 莫比乌斯反演 总目录详见 https://blog.csdn.net/mrcrack/article/details/104454762 在线测评地址 https://atcoder.jp/contests/abc162/tasks/abc162_e 思路同 https://www.cnblogs.com/zdragon1104/p/12688051.html 上式代表:a1,a2,...,aN的最大公约数等于i的组合数量 上式代表a1,a2,...,aN的最大公约数等于i的组合数量对应的最大公约数之和。 在该题中, AC代码如下 #include <stdio.h> #define mod 1000000007 #define maxn 100010 #define LL long long int n,k; int prime[maxn],not_prime[maxn],phi[maxn],tot; LL ans; LL quick_pow(LL a,LL b){//快速幂 LL ans=1; while(b){