码迷,mamicode.com
首页 >  
搜索关键字:median of two sorted    ( 17004个结果
【LeetCode】- Merge Sorted Array (合并有序数组)
[ 问题: ] 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
Leetcode:Edit Distance 字符串编辑距离
原题戳我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
codechef Sums in a Triangle题解
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
UVA - 12293 Box Game (规律)
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
NEFU 118
其实一道公式题: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 Tree & Convert Sorted List to Binary Search Tree
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
杭电1279 Stone Game(经典博弈)
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
HDU-3085-Nightmare Ⅱ(双向BFS)
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
43. Merge Sorted Array && LRU Cache
思想:因为 A 很大, 所以从最大值开始插入, 即从 A 的 m+n 位置开始插入数据。避免了冗余的移动。 思想: 1. 由于要 O(1) 时间确定某 key 是不是在 Cache 中,所以用 Hash_map (), 从而能够O(1)找到结点地址,返回对应的 value。 2. 由...
分类:其他好文   时间:2014-08-27 21:43:08    阅读次数:191
数论 : 高精度 --- UVa 10183 : How Many Fibs ?
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!