标签:class isp 莫比乌斯反演 gcd span splay mat prim 开始
题意:求\[\sum_{i=1}^{n}\sum_{j=1}^{m}[gcd(i,j) = prim]\]
题解:那就开始化式子吧!!
\[f(d) = \sum_{i=1}^{n}\sum_{j=1}^{m}[gcd(i,j) = d]\]
\[F(x) = \sum_{d|x} f(d) = \left \lfloor \frac{n}{x} \right \rfloor \left \lfloor \frac{m}{x} \right \rfloor\]
\[f(d) = \sum_{d|x} \mu\left ( \frac{x}{d} \right )F(x) \]
\[ans = \]
标签:class isp 莫比乌斯反演 gcd span splay mat prim 开始
原文地址:https://www.cnblogs.com/lwqq3/p/10346545.html