题目链接 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,6,12 are all 12's divisors. In this problem, given l,r and k, your task is to calculate the followin…
地址: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…
d(x)表示x的约数个数,让你求(l,r<=10^12,r-l<=10^6,k<=10^7) #include<cstdio> using namespace std; #define MOD 998244353ll #define MAXP 1000100 typedef long long ll; ll x,y; int T,K; bool isNotPrime[MAXP+10]; int num_prime,prime[MAXP+10]; void shai() { f…
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,…
题目 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…
Counting Divisors Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 2599 Accepted Submission(s): 959 Problem Description In mathematics, the function d(n) denotes the number of divisors of p…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1197 题意:给你两个数 a b,求区间 [a, b]内素数的个数, a and b (1 ≤ a ≤ b < 231, b - a ≤ 100000). 由于a和b较大,我们可以筛选所有[2, √b)内的素数,然后同时去筛选掉在区间[a, b)的数,用IsPrime[i-a] = 1表示i是素数: ///LightOj1197求区间素数的个数; #include<stdio.h&g…
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(…
题目大意: 给出T个实例,T<=200,给出[a,b]区间,问这个区间里面有多少个素数?(1 ≤ a ≤ b < 231, b - a ≤ 100000) 解题思路: 由于a,b的取值范围比较大,无法把这个区间内的所以素数全部筛选出来,但是b-a这个区间比较小,所以可以用区间素数筛选的办法解决这个题目. 代码: #include<cstdio> #include<cstring> #include<iostream> #include<algorith…
思路:对于n^k其实就是每个因子的个数乘了一个K.然后现在就变成了求每个数的每个质因子有多少个,但是比赛的时候只想到sqrt(n)的分解方法,总复杂度爆炸,就一直没过去,然后赛后看官方题解感觉好妙啊!通过类似素数筛法的方式,把L - R的质因子给分解,就可以在O(nlogn)的时间之内把所以的数给筛出来. /* gyt Live up to every day */ #include<cstdio> #include<cmath> #include<iostream>…
CodeForces - 27E Number With The Given Amount Of Divisors Submit Status Description Given the number n, find the smallest positive integer which has exactly n divisors. It is guaranteed that for the given n the answer will not exceed 1018. Input The…