描述:不使用 * / % 完成除法操作。O(n)复杂度会超时,需要O(lg(n))复杂度。代码: 1 class Solution: 2 # @return an integer 3 def dividePositive(self, dividend, divisor): 4 ...
分类:
其他好文 时间:
2014-07-16 19:18:00
阅读次数:
298
1 /** 2 * Definition for singly-linked list. 3 * public class ListNode { 4 * int val; 5 * ListNode next; 6 * ListNode(int x) { 7 * ...
分类:
编程语言 时间:
2014-07-16 17:45:41
阅读次数:
226
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1-...
分类:
其他好文 时间:
2014-07-16 17:30:52
阅读次数:
230
def Median(t): """中位数""" arr = sorted(t) idx = (len(arr) - 1) / 2 if type(idx) is int: return arr[idx] if type(idx) is float: ...
分类:
其他好文 时间:
2014-07-14 23:49:19
阅读次数:
334
/*
D - D
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Submit
Status
Practice
POJ 3414
Description
You are given two pots, having the volume of A and B liters resp...
分类:
其他好文 时间:
2014-07-14 17:16:04
阅读次数:
271
operator.itemgetter函数
operator模块提供的itemgetter函数用于获取对象的哪些维的数据,参数为一些序号(即需要获取的数据在对象中的序号),下面看例子。
a = [1,2,3]
>>> b=operator.itemgetter(1) //定义函数b,获取对象的第1个域的值
>>> b(a)
2
>>> b=operator.item...
分类:
编程语言 时间:
2014-07-14 16:59:58
阅读次数:
229
BACKGROUND1. FieldThe present invention generally relates to rendering two-dimension representations from three-dimensional scenes, and more particula...
分类:
其他好文 时间:
2014-07-14 14:39:07
阅读次数:
278
FIELD OF INVENTIONThis invention relates to computer graphics processing, and more specifically to computer graphics processing using two or more arch...
分类:
其他好文 时间:
2014-07-14 14:21:10
阅读次数:
272
描述
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in ...
分类:
其他好文 时间:
2014-07-14 13:46:43
阅读次数:
229
Flip Game
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 29921
Accepted: 12975
Description
Flip game is played on a rectangular 4x4 field with two-sided...
分类:
其他好文 时间:
2014-07-14 12:46:46
阅读次数:
229