码迷,mamicode.com
首页 > 其他好文 > 详细

Crash

时间:2018-05-29 00:08:24      阅读:228      评论:0      收藏:0      [点我收藏+]

标签: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)$

Crash

标签:ash   AC   floor   ==   its   tar   mit   limits   row   

原文地址:https://www.cnblogs.com/ShuraK/p/9102631.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!