[ 问题: ]
Given two sorted integer arrays A and B, merge B into A as one sorted array.
直译:给定两个排好序的整形数组,将数组B合并到数组A,形成一个新的有序数组。...
分类:
其他好文 时间:
2014-08-28 14:53:19
阅读次数:
214
原题戳我Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You ha...
分类:
其他好文 时间:
2014-08-28 13:04:59
阅读次数:
162
Let's consider a triangle of numbers in which a number appears in the first line, two numbers appear in the second line, three in the third line, etc....
分类:
其他好文 时间:
2014-08-28 13:03:29
阅读次数:
218
Description
Box Game
There are two identical boxes. One of them contains n balls, while the other box contains one ball. Alice and Bob invented a game with the boxes and bal...
分类:
其他好文 时间:
2014-08-28 09:41:09
阅读次数:
189
其实一道公式题:n!中素数i的幂为:[n/i]+[n/i^2]+[n/i^3]+[n/i^4]+......#include #include #include using namespace std;long long n;int main(){ long long two,five; int t...
分类:
其他好文 时间:
2014-08-28 09:38:59
阅读次数:
131
Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.方法:将有序数组转为平...
分类:
其他好文 时间:
2014-08-27 23:17:18
阅读次数:
278
Stone Game
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)
Total Submission(s): 2539 Accepted Submission(s): 741
Problem Description
This game is a two-p...
分类:
其他好文 时间:
2014-08-27 22:03:38
阅读次数:
244
Problem Description
Last night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the maz...
分类:
Web程序 时间:
2014-08-27 22:03:18
阅读次数:
255
思想:因为 A 很大, 所以从最大值开始插入, 即从 A 的 m+n 位置开始插入数据。避免了冗余的移动。
思想:
1. 由于要 O(1) 时间确定某 key 是不是在 Cache 中,所以用 Hash_map (), 从而能够O(1)找到结点地址,返回对应的 value。
2. 由...
分类:
其他好文 时间:
2014-08-27 21:43:08
阅读次数:
191
How many Fibs?DescriptionRecall the definition of the Fibonacci numbers:f1 := 1 f2 := 2 fn := fn-1 + fn-2 (n>=3) Given two numbers a and b, calcul...
分类:
其他好文 时间:
2014-08-27 20:17:48
阅读次数:
208