码迷,mamicode.com
首页 >  
搜索关键字:prime    ( 2475个结果
[LeetCode] 204. Count Primes 计数质数
Description: Count the number of prime numbers less than a non-negative number, n click to show more hints. References: How Many Primes Are There? Sie ...
分类:其他好文   时间:2018-03-12 17:04:24    阅读次数:2473
263. Ugly Number(判断是否是丑数 剑指offer34)
Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa ...
分类:其他好文   时间:2018-03-11 17:37:40    阅读次数:143
264. Ugly Number II(丑数 剑指offer 34)
Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, ...
分类:其他好文   时间:2018-03-11 17:27:18    阅读次数:141
zoj 2723 Semi-Prime(素筛打表+搜索优化)
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2723 题目描述: Prime Number Definition An integer greater than one is called a prime nu ...
分类:其他好文   时间:2018-03-11 14:39:30    阅读次数:226
求小于n的素数个数
本文是对 LeetCode "Count Primes" 解法的探讨。 题目: Count the number of prime numbers less than a non negative number, n. 尽管题目并没有要我们写一个最优的算法,但是身为一个程序员,优化应该是一种习惯,在 ...
分类:其他好文   时间:2018-03-11 02:50:44    阅读次数:212
Sgu294He's Circles
Description 有一个长度为N的环,上面写着’X’和’E’,问本质不同的环有多少种。(N不超过200000)。 Input The input file contains a single integer 1 include include include include define in ...
分类:其他好文   时间:2018-03-07 21:49:52    阅读次数:181
外挂技术汇总及书籍推荐
本节介绍游戏安全领域一些入门必备书籍,包含开发、逆向和游戏安全基础。读者可以根据自身情况选择性阅读。 1.开发基础 游戏安全领域逆向是核心技能,但在学习逆向技术之前,必须拥有牢固的开发基础。因为编写外挂需要一定的开发基础;再来只有有一定开发基础,并对程序架构,运行原理了解,才能在逆向领域走的更深入。 ...
分类:其他好文   时间:2018-03-07 15:20:51    阅读次数:1081
POJ 2689 Prime Distance
筛法的应用 因为直接算是不可能的, 我们可以处理出 $$ 1~\sqrt n $$的所有质数,然后筛掉$$L~R$$ 区间内的所有质数 注意: 线性筛的时候,注意n与数组大小的关系,防止RE 与素数有关的一定要特判1的情况 cpp include include include include in ...
分类:其他好文   时间:2018-03-07 13:34:52    阅读次数:200
BZOJ1101: [POI2007]Zap(莫比乌斯反演)
1101: [POI2007]Zap Description FGD正在破解一段密码,他需要回答很多类似的问题:对于给定的整数a,b和d,有多少正整数对x,y,满足x<=a,y<=b,并且gcd(x,y)=d。作为FGD的同学,FGD希望得到你的帮助。 FGD正在破解一段密码,他需要回答很多类似的问 ...
分类:其他好文   时间:2018-03-06 23:16:16    阅读次数:197
【XSY2719】prime 莫比乌斯反演
题目描述 设$f(i)$为$i$的不同的质因子个数,求$\sum_{i=1}^n2^{f(i)}$ $n\leq{10}^{12}$ 题解 考虑$2^{f(i)}$的意义:有$f(i)$总因子,每种可以分给两个人中的一个。那么就有$2^{f(i)}=\sum_{d|i}[\gcd(d,\frac{i ...
分类:其他好文   时间:2018-03-06 12:51:50    阅读次数:138
2475条   上一页 1 ... 66 67 68 69 70 ... 248 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!