Given a sorted integer array where the range of elements are [lower,upper] inclusive, return its missing ranges.For example, given[0, 1, 3, 50, 75],lo...
分类:
其他好文 时间:
2015-02-08 23:10:57
阅读次数:
290
欢迎转载,如有错误或疑问请留言纠正,谢谢
Given a sorted array of integers, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
I...
分类:
其他好文 时间:
2015-02-08 12:57:17
阅读次数:
171
题目要求:Search for a RangeGiven a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime comple...
分类:
其他好文 时间:
2015-02-07 18:41:47
阅读次数:
121
题目描述:Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.分析:① 输入为VII,则数字为V + I +...
分类:
其他好文 时间:
2015-02-07 15:50:36
阅读次数:
150
题目描述:Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.罗马数字的计数方法:基本字符IVXLCDM相应...
分类:
其他好文 时间:
2015-02-07 15:41:19
阅读次数:
145
题意:已经懒得吐槽了。。有N个山峰,(N
它高的山峰都会经过一个最低值(山谷),d代表是h减去这些最低值中的最大值的差(如果不存在比它高的山峰那么d就是它本身的
高度),问有多少山峰的d>=150000米。
思路:利用单调栈维护每个峰左边第一个比它高的峰的位置l,右边第一个比它高的峰的位置r,对于r,我们从前向后维护一个单调减
序列,如果当前考虑的点i比栈顶的元素高度高,那么弹出栈顶元素,...
分类:
其他好文 时间:
2015-02-07 09:12:30
阅读次数:
137
题目描述:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 这道题很简单,我就直接贴答案了。solution1:int romanTo....
分类:
其他好文 时间:
2015-02-06 23:10:02
阅读次数:
136
Given a sorted integer array where the range of elements are [lower,upper] inclusive, return its missing ranges.For example, given[0, 1, 3, 50, 75],lo...
分类:
其他好文 时间:
2015-02-06 21:46:55
阅读次数:
232
python 未入门,练练手,锻炼一下智力。只适合跟我一样的菜鸟 #coding = utf-8import timeimport syscount = 0m = 0mm = 0h = 0hh =0while True: for i in range(0,11): ...
分类:
其他好文 时间:
2015-02-06 20:27:19
阅读次数:
167
Lost Cows
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9477
Accepted: 6110
Description
N (2 <= N <= 8,000) cows have unique brands in the range 1..N. In...
分类:
编程语言 时间:
2015-02-06 09:36:34
阅读次数:
125