DIVCNT2 - Counting Divisors (square) #sub-linear #dirichlet-generating-function Let \sigma_0(n)σ​0​​(n) be the number of positive divisors of nn. For example, \sigma_0(1) = 1σ​0​​(1)=1, \sigma_0(2) = 2σ​0​​(2)=2 and \sigma_0(6) = 4σ​0​​(6)=4. LetS_2(…
题目 vjudge URL:Counting Divisors (square) Let σ0(n)\sigma_0(n)σ0​(n) be the number of positive divisors of nnn. For example, σ0(1)=1\sigma_0(1) = 1σ0​(1)=1, σ0(2)=2\sigma_0(2) = 2σ0​(2)=2 and σ0(6)=4\sigma_0(6) = 4σ0​(6)=4. Let S2(n)=∑i=1nσ0(i2).S_2(n…
设 \[f(n)=\sum_{d|n}\mu^2(d)\] 则 \[\begin{eqnarray*}\sigma_0(n^2)&=&\sum_{d|n}f(d)\\ans&=&\sum_{i=1}^n\sigma_0(i^2)\\&=&\sum_{i=1}^n\sum_{d|i}\sum_{k|d}\mu^2(k)\\&=&\sum_{k=1}^n\mu^2(k)G(\lfloor\frac{n}{k}\rfloor)\end{eqnarr…
Refer 主要思路参考了 Command_block 的题解. Description 给定 \(n\)(\(n\le 10^{10}\)),求 \[\sum_{i=1}^n\sigma_0(i^2) \mod 2^{64} \] Solution 首先有一个惯例套路: \[\sigma_0(i\cdot j)=\sum_{x|i}\sum_{y|j}\left[\gcd(x,y)=1\right] \] 在 [SDOI2015]约数个数和 以及 BZOJ4176 Lucas的数论 中,我们将…
DIVCNT2 - Counting Divisors (square) DIVCNT3 - Counting Divisors (cube) 杜教筛 [学习笔记]杜教筛 (其实不算是杜教筛,类似杜教筛的复杂度分析而已) 你要大力推式子: 把约数个数代换了 把2^质因子个数 代换了 构造出卷积,然后大于n^(2/3)还要搞出约数个数的式子和无完全平方数的个数的容斥... .... 然后恭喜你,spoj上过不去... bzoj能过: #include<bits/stdc++.h> #define…
http://acm.tzc.edu.cn/acmhome/vProblemList.do?method=problemdetail&oj=SPOJ&pid=DIVCNT2 给出n求 其中是除数函数,0代表0次方. #include<algorithm> #include<cstdio> #include<cmath> #include<cstring> #include<iostream> #define ll long lon…
Counting Divisors Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1604    Accepted Submission(s): 592 Problem Description In mathematics, the function d(n) denotes the number of divisors of p…
Counting Divisors Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 3170    Accepted Submission(s): 1184 Problem Description In mathematics, the function d(n) denotes the number of divisors of…
Counting Divisors Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Problem Description In mathematics, the function d(n) denotes the number of divisors of positive integer n. For example, d(12)=6 because 1,2,3,4,…
地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=6069 题目: Counting Divisors Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1235    Accepted Submission(s): 433 Problem Description In mathem…