题目 Count the number of prime numbers less than a non negative number, n. Example: Input: 10 Output: 4 Explanation: There are 4 prime numbers less than ...
分类:
其他好文 时间:
2018-10-12 13:54:06
阅读次数:
120
198. House Robber 202. Happy Number 204. Count Primes 219. Contains Duplicate II 固定窗口滑动 219. Contains Duplicate II 固定窗口滑动 class Solution { public: boo ...
分类:
其他好文 时间:
2018-10-04 10:54:52
阅读次数:
131
204. Count Primes 204. Count Primes 204. Count Primes 204. Count Primes Count the number of prime numbers less than a non-negative number, n. Example: ...
分类:
其他好文 时间:
2018-09-26 00:12:10
阅读次数:
158
https://pintia.cn/problem-sets/994805342720868352/problems/994805495863296000 A reversible prime in any number system is a prime whose "reverse" in th ...
分类:
其他好文 时间:
2018-09-18 19:56:00
阅读次数:
154
质数(prime number)又称素数,有无限个。质数定义为在大于1的自然数中,除了1和它本身以外不再有其他因数。 class Solution { public: int countPrimes(int n) { if(n < 2) return 0; bool result[n]; for(i ...
分类:
其他好文 时间:
2018-09-15 21:17:58
阅读次数:
126
题意:求使pi(n)*q<=rub(n)*p成立的最大的n。 先收集所有的质数和回文数。质数好搜集。回文数奇回文就0-9的数字,然后在头尾添加一个数。在x前后加a,就是x*10+a+a*pow(10,2)。偶回文同理。然后不能二分,因为比值不是单调的。 乱码: ...
分类:
其他好文 时间:
2018-09-14 14:00:36
阅读次数:
173
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re ...
分类:
其他好文 时间:
2018-09-03 17:20:31
阅读次数:
170
public class Test { public static void main(String[] args) { int [] primes = new int[50]; //存放素数的数组 primes[0]=2; //数组的第一个素数是2 int cnt = 1; //标记数组里头存放的... ...
分类:
其他好文 时间:
2018-08-13 20:57:50
阅读次数:
581
ls特别喜欢素数,他总是喜欢把素数集合的所有子集写下来,并按照一定的顺序和格式。对于每一个子集,集合内 的元素在写下来时是按照升序排序的,对于若干个集合,则以集合元素之和作为第一关键字,集合的字典序作为第 二关键字(先比较集合第一个元素,再比较第二个元素,以此类推),这个序列的开始如下:[2], [ ...
分类:
其他好文 时间:
2018-07-30 11:26:51
阅读次数:
166
A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re ...
分类:
其他好文 时间:
2018-07-28 12:07:02
阅读次数:
126