10001st prime
Problem 7
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
python code :
import ma...
分类:
编程语言 时间:
2015-01-26 22:47:11
阅读次数:
208
Largest product in a series
Problem 8
The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.
73167176531330624919225119674426574742355349...
分类:
编程语言 时间:
2015-01-26 22:46:14
阅读次数:
357
题意:给你两个数p和x,然后让你找出一个长度为p的数,把它的最后移到最前面之后得到的数是原来数字的x倍,有很多这样的数取最小。思路:枚举最后一位,然后就可以推出整个的一个数,然后比较得到的数的第一个数字和枚举的数字是否相等既可以。 1 #include 2 #include 3 #include.....
分类:
其他好文 时间:
2015-01-26 22:43:06
阅读次数:
233
Problem 3
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
python code:
import math
sqrt=math.sqrt
def func(x):
...
分类:
编程语言 时间:
2015-01-26 21:07:23
阅读次数:
216
1、number数字可以直接在python运算,使用圆括号分组In[1]:2+2
Out[1]:4
In[2]:50-5*6
Out[2]:20
In[3]:(50-5.0*6)/4
Out[3]:5.0
In[4]:8/5.0
Out[4]:1.6在进行除法/的时候,如果2个除数都是int型,则返回的值也为整型int:如果有1个除数为浮点型float,则结果值为浮点型float..
分类:
编程语言 时间:
2015-01-26 19:29:46
阅读次数:
224
Description
A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it distributes software (th...
分类:
移动开发 时间:
2015-01-26 19:22:23
阅读次数:
214
A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N. No two places have the same number. The lines are bid...
分类:
Web程序 时间:
2015-01-26 19:20:13
阅读次数:
165
问题描述:
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the l...
分类:
其他好文 时间:
2015-01-26 19:18:05
阅读次数:
145
select trim(translate(RTRIM(LTRIM(ITEM_NUMBER)), '#0123456789', '#')) from TestCharWhere trim(translate(RTRIM(LTRIM(ITEM_NUMBER)), '#0123456789', '#')...
分类:
数据库 时间:
2015-01-26 19:03:09
阅读次数:
173
原题地址先将数字转成字符串,然后排序,让能够组成更大数字的字符串放在前面,最后拼接成完整的字符串即可。有种很巧妙的方法判断两个字符串的大小关系,假设两个字符串是A,B,则比较AB和BA,若AB比BA大,说明A应该放在前面,即A &num) { 2 string res; 3 4 vecto...
分类:
其他好文 时间:
2015-01-26 19:00:19
阅读次数:
129