码迷,mamicode.com
首页 >  
搜索关键字:median of two sorted    ( 17004个结果
python 中 sorted() 和 list.sort() 的用法
今天用python自带的sorted对一个列表进行排序, 在这里总结一下只要是可迭代对象都可以用sorted 。sorted(itrearble, cmp=None, key=None, reverse=False)=号后面是默认值 默认是升序排序的, 如果想让结果降序排列,用reverse=Tru...
分类:编程语言   时间:2014-07-26 14:49:40    阅读次数:284
E - Power Strings,求最小周期串
E -Power StringsTime Limit:3000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 2406DescriptionGiven two strings a and b we ...
分类:其他好文   时间:2014-07-26 14:10:16    阅读次数:201
kmp
Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 #includeintnext[10005];ints[1000005],p[10005];intn,m;void...
分类:其他好文   时间:2014-07-26 13:46:34    阅读次数:297
Merge k Sorted Lists leetcode java
题目:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.题解:Merge k sorted linked list就是merge 2 sorted li....
分类:编程语言   时间:2014-07-26 05:44:37    阅读次数:304
[ACM] ZOJ 3725 Painting Storages (DP计数+组合)
Painting Storages Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a straight highway with N storages alongside it labeled by 1,2,3,...,N. Bob asks you to paint all storages with two...
分类:其他好文   时间:2014-07-26 02:48:17    阅读次数:178
xtu字符串 B. Power Strings
B. Power StringsTime Limit: 3000msMemory Limit: 65536KB64-bit integer IO format:%lld Java class name:MainGiven two strings a and b we define a*b to be...
分类:其他好文   时间:2014-07-26 01:25:26    阅读次数:300
LeetCode:two sum
题目:如果采取暴力搜索,复杂度为O(n2),会超时解法1:构建Node类,存储输入的数据和它们的下标。用sort按升序排序(其中lambda可以写成一个返回值为bool类型的函数)。设置i和j,分别指向容器的头和尾。如果和大于target,尾向前移,如果和小于target,头向后移。直至找出和等于t...
分类:其他好文   时间:2014-07-26 00:31:46    阅读次数:223
【leetcode刷题笔记】Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega...
分类:其他好文   时间:2014-07-26 00:23:26    阅读次数:242
zoj 2974 Just Pour the Water矩阵快速幂
Just Pour the WaterTime Limit: 2 Seconds Memory Limit: 65536 KBShirly is a very clever girl. Now she has two containers (A and B), each with some wat....
分类:其他好文   时间:2014-07-25 18:58:22    阅读次数:374
每日一道题2014/7/24
Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the...
分类:其他好文   时间:2014-07-25 03:15:41    阅读次数:176
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!