摘要:
Description 求\(\sum_{i=1}^n[i,n],n\leqslant 10^9,T\leqslant 5\times 10^4\) Solution 数论+欧拉函数... 破题有毒... 推导和BZOJ 2226: [Spoj 5971] LCMSum一样... 但是需要枚举所有约 阅读全文
摘要:
Description 求\(\sum_{i=1}^n(i,n),n\leqslant 10^9\) Solution \(\sum_{i=1}^n(i,n)=\sum_{d\mid n}d\sum_{i=1}^n[(i,n)=d]=\sum_{d\mid n}\sum_{i=1}^{\frac{n 阅读全文
摘要:
Description 已知\(N^2-3N+2=\sum_{d|N} f(d)\),求\(\sum_{i=1}^nf(i),n\leqslant 10^9\) Solution 杜教筛+莫比乌斯反演... 入门题... 令\(g(n)=n^2-3n+2\).. 那么\(\sum_{i=1}^ng( 阅读全文