CF1474-B. Different Divisors】的更多相关文章

E. Number With The Given Amount Of Divisors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Given the number n, find the smallest positive integer which has exactly n divisors. It is guara…
Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Now given a humble number, please write…
计算小于n的数中,约数个数最多的数,若有多个最输出最小的一个数. http://hihocoder.com/problemset/problem/1187 对于100有 60 = 2 * 2 * 3 * 5,共 (2 + 1) * (1 + 1) * (1 + 1) = 12个约数. 对于 n <= 10 ^ 16,int最大值为10位,所以这里要用long long.很显然:约数要尽量小,然后小的约数的指数一定大于大的约数的指数. 所以对于 10^16,有质因子:2,3,5,7,11,13,1…
Xenia and Divisors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Xenia the mathematician has a sequence consisting of n (n is divisible by 3) positive integers, each of them is at most 7…
传送门 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Given an integer n, for all integers not larger than n, find the integer with the most divisors. If there is more than one integer with the same number of divisors, print the minimum one. 输入 One line with an…
The number of divisors(约数) about Humble Numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2044    Accepted Submission(s): 1006 Problem DescriptionA number whose only prime factors are 2,3,…
Problem Description mmm is learning division, she's so proud of herself that she can figure out the sum of all the divisors of numbers no larger than 100 within one day!But her teacher said "What if I ask you to give not only the sum but the square-s…
B. Petya and Divisors Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/111/problem/B Description Little Petya loves looking for numbers' divisors. One day Petya came across the following problem: You are given n queries in t…
题意: 求区间[L, U]的正因数的个数. 分析: 有这样一条公式,将n分解为,则n的正因数的个数为 事先打好素数表,按照上面的公式统计出最大值即可. #include <cstdio> #include <cmath> ; ]; ], cnt = ; void Init() { int m = sqrt(maxn + 0.5); ; i <= m; ++i) if(!vis[i]) for(int j = i * i; j <= maxn; j += i) vis[j…
Sum of divisors Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2063    Accepted Submission(s): 718 Problem Description mmm is learning division, she's so proud of herself that she can figure o…