题目:Max Points on a lineGiven n points on a 2D plane, find the maximum number of points that lie on the same straight line.这道题需要稍微转变一下思路,用斜率来实现,试想找在同一条...
分类:
其他好文 时间:
2014-09-26 21:42:28
阅读次数:
147
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the larges...
分类:
其他好文 时间:
2014-09-26 15:03:38
阅读次数:
359
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the larges...
分类:
其他好文 时间:
2014-09-26 01:16:58
阅读次数:
271
网页自适应手机、电脑屏幕的设置方法 Insert title here 第一个meta标签表示: 强制让文档与设备的宽度保持1:1; 文档最大的宽度比列是1.0(initial-scale初始刻度值和maximum-scale最大刻度值); user-scala...
分类:
Web程序 时间:
2014-09-25 19:22:07
阅读次数:
186
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the...
分类:
其他好文 时间:
2014-09-25 15:11:49
阅读次数:
209
题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,...
分类:
编程语言 时间:
2014-09-25 13:26:28
阅读次数:
281
LinkedIn 高频题 – Maximum Sum/ProductSubarrayMaximum Sum Subarray是leetcode原题,跟Gas Station的想法几乎一模一样。解答中用到的结论需要用数学简单地证明一下。123456789101112public int maxSubA...
分类:
其他好文 时间:
2014-09-25 13:16:18
阅读次数:
223
这两道题都是用的尺取法。尺取法是《挑战程序设计竞赛》里讲的一种常用技巧。就是O(n)的扫一遍数组,扫完了答案也就出来了,这过程中要求问题具有这样的性质:头指针向前走(s++)以后,尾指针(t)要么不动要么也往前走。满足这种特点的就可以考虑尺取法。poj3061 比较简单,也可以用二分做,时间复杂度O...
分类:
其他好文 时间:
2014-09-25 02:11:38
阅读次数:
245
分治法,采用一种“分治(divide-and-conquer)”的...
分类:
其他好文 时间:
2014-09-24 18:58:57
阅读次数:
283
Flow Problem
Problem Description
Network flow is a well-known difficult problem for ACMers. Given a graph, your task is to find out the maximum flow for the weighted directed graph....
分类:
其他好文 时间:
2014-09-24 18:35:37
阅读次数:
272