Find number which appears more than half times
of array length.
分类:
移动开发 时间:
2014-05-27 00:16:48
阅读次数:
339
Given an array of integers, every element appears
three times except for one. Find that single one. Note: Your algorithm should
have a linear runtime ...
分类:
其他好文 时间:
2014-05-27 00:10:26
阅读次数:
319
出题:将只包含2,3,5的因子的数称为丑数(Ugly
Number),要求找到前面1500个丑数;分析:解法1:依次判断从1开始的每一个整数,2,3,5是因子则整数必须可以被他们其中的一个整除,如果不包含任何其他因子则最终的结果为1;解法2:小丑数必然是某个大丑数的因子,也就是乘以2,3,或者5之后...
分类:
其他好文 时间:
2014-05-27 00:10:04
阅读次数:
402
Smallest multiple
Problem 5
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly di...
分类:
其他好文 时间:
2014-05-23 01:51:13
阅读次数:
261
H. Happy Reversal
64-bit integer IO format: %lld
Java class name: Main
Elfness is studying in an operation "NOT".
For a binary number A, if we do operation "NOT A", after that, all digit...
分类:
移动开发 时间:
2014-05-23 00:43:49
阅读次数:
430
--创建表
createtable JOBTEST (
IDVARCHAR2(50)
primarykey,
NAMEVARCHAR2(20),
AGE NUMBER(3) )
--创建存储过程
createorreplaceprocedure
jobtestprocedure
isbegin
insertinto jobtest
values(to_char(s...
分类:
数据库 时间:
2014-05-22 18:52:39
阅读次数:
359
Problem 4: Largest palindrome product
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest pal...
分类:
其他好文 时间:
2014-05-22 18:48:46
阅读次数:
355
Problem 3: Largest prime factor
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
求出最大素因子
我的python代码如下:
又不懂的,或者更好的可以留言,大家互相...
分类:
其他好文 时间:
2014-05-22 18:40:17
阅读次数:
198
【题目】
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Your goal is to reach the last index in the minimum number of ju...
分类:
其他好文 时间:
2014-05-22 17:02:20
阅读次数:
244
SQL Server 2005引入的新方法。SELECT * FROM (SELECT
ROW_NUMBER() OVER(ORDER BY keyField DESC) AS rowNum, * FROM tableName) AS t
WHERE rowNum > start AND rowNu...
分类:
数据库 时间:
2014-05-22 14:22:58
阅读次数:
351