ZOJ-2562 More Divisors 反素数】的更多相关文章

反素数: 对于不论什么正整数x,起约数的个数记做g(x).比如g(1)=1,g(6)=4. 假设某个正整数x满足:对于随意i(0<i<x),都有g(i)<g(x),则称x为反素数. ZOJ 2562 反素数 由于写了POJ 2886的线段树.然后里面有反素数,曾经没遇到过,所以先搞这两题普及一下知识再说. #include<iostream> #include<cstdio> #include<cstring> #include<algorith…
ZOJ 2562 More Divisors(高合成数) ACM 题目地址:ZOJ 2562 More Divisors 题意:  求小于n的最大的高合成数,高合成数指一类整数,不论什么比它小的自然数的因子数目均比这个数的因子数目少. 分析:  网上都叫它反素数,事实上我查了一下,翻素数应该是正着写倒着写都是素数的素数.这个应该叫高合成数,见Wikipedia: Highly composite number 高合成数有下面特征:  where p1<p2<⋯<pk are prime,…
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…
题意:给定一个数N,求小于等于N的所有数当中,约数最多的一个数,如果存在多个这样的数,输出其中最大的一个. 分析:反素数定义:对于任何正整数x,其约数的个数记做g(x).例如g(1)=1,g(6)=4.如果某个正整数x满足:对于任意i(0<i<x),都有g(i)<g(x),则称x为反素数. 性质一:一个反素数的质因子必然是从2开始连续的质数.性质二:p=2^t1*3^t2*5^t3*7^t4.....必然t1>=t2>=t3>=.... 那题题目相当于求解小于等于N中,…
又是个水题,刚刚开始没有用搜索,因为对于反素数有: n=2^t1*3^t2^5^t3*7^t4..... 这里有 t1>=t2>=t3>=t4. 而且相同的因数的情况下,素数越不同越好. 哪知道这个方法错了! = =. 看来还得中规中矩得用dfs. 我觉得还可以优化下,感觉搜索干了很多无用的活儿. 搜索还得好好练练啊... #include<cstdio> #define LL long long using namespace std; ] = { , , , , , ,…
More Divisors Time Limit: 2 Seconds      Memory Limit: 65536 KB Everybody knows that we use decimal notation, i.e. the base of our notation is 10. Historians say that it is so because men have ten fingers. Maybe they are right. However, this is often…
题目大意:求n范围内最大的反素数(反素数定义:f(x)表示x的因子数,f(x)>f(x1) (0<x1<x)) x用质因数形式为:x=a1^p1*a2^p2......an^pn(ai为素数),那么一个数的因子个数f(x)=(p1+1)*(p2+1)*....*(pn+1) 反素数的性质有:x=a1^p1*a2^p2......an^pn,p1>=p2>=......>=pn 证明:若pi<pj(i<j),那么存在与它因子个数相等的x1且x1<x,与反…
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…
反素数的定义:对于不论什么正整数,其约数个数记为.比如,假设某个正整数满足:对随意的正整 数.都有,那么称为反素数. 从反素数的定义中能够看出两个性质: (1)一个反素数的全部质因子必定是从2開始的连续若干个质数.由于反素数是保证约数个数为的这个数尽量小 (2)相同的道理,假设,那么必有 个人理解性证明: 对(1)如果不是从2開始,那么如果n的最小素因素是k,把k换成2,2的次数仍等于k的次数,得到N,可知,N<n,而且f(n)==f(N).与n是反素数矛盾 对(2)如果ti<tj   ti,…
Who Gets the Most Candies? Time Limit: 5000 MS Memory Limit: 0 KB 64-bit integer IO format: %I64d , %I64u Java class name: Main [Submit] [Status] [Discuss] Description N children are sitting in a circle to play a game. The children are numbered from…