BZOJ 3561 DZY Loves Math VI

BZOJ 3561 DZY Loves Math VI


\(\sum_{i=1}^{n}\sum_{j=1}^{m}\text{lcm}(i,j)^{\gcd(i,j)}\),钦定\(n\leq m\)

\(\sum_{i=1}^{n}\sum_{j=1}^{m}(\frac{ij}{{\gcd(i,j)}})^{\gcd(i,j)}\)

按套路,提出\(\gcd(i,j)\),枚举的\(i\)\(j\)都除\(g\)

\(\sum_{g=1}^ng^g\sum_{i=1}^{n/g}\sum_{j=1}^{m/g}(ij)^g[gcd(i,j)=1]\)

\([gcd(i,j)=1]\)改成约数mu之和

\(\sum_{g=1}^ng^g\sum_{i=1}^{n/g}\sum_{j=1}^{m/g}(ij)^g\sum_{k|gcd(i,j)}\mu(k)\)

\(\sum_{g=1}^ng^g\sum_{k=1}^{n/g}\mu(k)k^{2g}\sum_{i=1}^{n/gk}\sum_{j=1}^{m/gk}(ij)^g\)

\(\sum_{g=1}^ng^g\sum_{k=1}^{n/g}\mu(k)k^{2g}\sum_{i=1}^{n/gk}i^g\sum_{j=1}^{m/gk}j^g\)

然后就能暴力求了。23333

posted @ 2019-03-09 17:29  菜狗xzz  阅读(172)  评论(0编辑  收藏  举报