我们可以枚举每一个质数,那么答案就是 $\sum_{p}\sum_{d<=n}\mu(d)*\lfloor n / pd \rfloor *\lfloor m / pd \rfloor$ 直接做?TLE 考虑优化,由于看到了pd是成对出现的,令T=pd $ans=\sum_{T<=min(n,m)}\lfloor n / T \rfloor *\lfloor m / T \rfloor \sum_{p \mid T}\mu(T/p)$ 或者 $ans=\sum_{T<=min(n,m)}…
4491. Primes in GCD Table Problem code: PGCD Johnny has created a table which encodes the results of some operation -- a function of two arguments. But instead of a boring multiplication table of the sort you learn by heart at prep-school, he has cre…