标签:ash AC floor == its tar mit limits row
$\sum\limits_{i=1}^n\sum\limits_{j=1}^{m}lcm(i,j)$
$\ \ \ \ \sum\limits_{i=1}^n\sum\limits_{j=1}^{m}lcm(i,j)\\
\Rightarrow\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{m}\frac{ij}{gcd(i,j)}\\
\Rightarrow\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{m}\sum\limits_{d=1}^{min(n,m)}[gcd(i,j)==d]\cdot \frac{ij}{d}\\
\Rightarrow\sum\limits_{d=1}^{min(n,m)}\sum\limits_{i=1}^{\lfloor\frac{n}{d}\rfloor}\sum\limits_{j=1}^{\lfloor\frac{m}{d}\rfloor}[gcd(i,j)==1]dij\\
\Rightarrow\sum\limits_{d=1}^{min(n,m)}d\sum\limits_{i=1}^{\lfloor\frac{n}{d}\rfloor}\sum\limits_{j=1}^{\lfloor\frac{m}{d}\rfloor}ij\sum\limits_{k|gcd(i,j)}\mu(k)\\
\Rightarrow\sum\limits_{d=1}^{min(n,m)}d\sum\limits_{k=1}^{\lfloor\frac{min(n,m)}{d}\rfloor}\mu(k)\sum\limits_{i=1}^{\lfloor\frac{n}{dk}\rfloor}\sum\limits_{j=1}^{\lfloor\frac{m}{dk}\rfloor}ij\cdot k^2\\
\Rightarrow\sum\limits_{d=1}^{min(n,m)}d\sum\limits_{k=1}^{\lfloor\frac{min(n,m)}{d}\rfloor}\mu(k)k^2\cdot sum(\lfloor\frac{n}{dk}\rfloor)sum(\lfloor\frac{m}{dk}\rfloor)$
标签:ash AC floor == its tar mit limits row
原文地址:https://www.cnblogs.com/ShuraK/p/9102631.html