题目:There is a clever algorithm for computing the Fibonacci numbers in a logarithmic number of steps.Recall the transformation of the state variables a...
分类:
其他好文 时间:
2014-10-22 17:46:46
阅读次数:
108
1.具有相同core id的cpu是同一个core的超线程。(Physical id and core id are not necessarily consecutive but they are unique. Any cpu with the same core id are hyperthr...
分类:
编程语言 时间:
2014-10-22 17:24:31
阅读次数:
286
A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta...
分类:
其他好文 时间:
2014-10-22 14:15:29
阅读次数:
134
problem:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not...
分类:
其他好文 时间:
2014-10-22 06:18:10
阅读次数:
149
11598. XORConstraintsTime Limit: 1 secs, Memory Limit: 256 MBDescriptionGiven two integersSandF, what is the XOR (exclusive-or) of all numbers between...
分类:
其他好文 时间:
2014-10-21 22:59:43
阅读次数:
438
Two Sum
Total Accepted:
37848 Total Submissions:
206006
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return ...
分类:
其他好文 时间:
2014-10-21 21:44:10
阅读次数:
267
Problem Description
Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b...
分类:
其他好文 时间:
2014-10-21 21:38:27
阅读次数:
258
Encode a string by counting the consecutive letter. (i.e., "aaaabbxxxyyz" might become "a4b2x3y2z1"). 分析: 这个问题是一个基本的数据压缩算法,将相邻的字符计数存储。解法没有什么特别需要注意的地方,...
分类:
Web程序 时间:
2014-10-21 19:17:38
阅读次数:
153
[leetcode]Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited number of times....
分类:
其他好文 时间:
2014-10-21 12:22:27
阅读次数:
170
题意:问第n(n
题目链接:http://poj.org/problem?id=1338
——>>1, 2, 3, 4, 5, 6, 8, ...
假设小根堆存以上丑数,那么每次取出最小的数,这个最小的数nMin,它可以生成三个数:nMin * 2, nMin * 3, nMin * 5,将这三个数放入小根堆继续,一直复筛出1500个丑数为止。
小根堆可用优先队列来替代。
#inclu...
分类:
其他好文 时间:
2014-10-21 10:21:52
阅读次数:
215