Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] ha...
分类:
其他好文 时间:
2014-12-12 19:12:27
阅读次数:
205
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-12-11 20:49:19
阅读次数:
177
Largest prime factor
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7297 Accepted Submission(s): 2589
Problem Description
Every...
分类:
其他好文 时间:
2014-12-10 12:35:08
阅读次数:
174
题目:HDU5128The E-pang Palace解题思路:1.由于pillar的个数只有30个,故rectangular的个数最多15*14/2=105个,故可用暴力解法枚举rectangular的个数。 2.把每个点都作为rectangular左下角的点,进行枚举所有。 3....
分类:
其他好文 时间:
2014-12-08 21:18:04
阅读次数:
196
题目大意:每个素数在素数表中都有一个序号,设1的序号为0,则2
的序号为1,3的序号为2,5的序号为3,以此类推。现在要求输出所
给定的数n的最大质因子的序号,0<n<1000000。
思路:巧用素数打表法。用sum计算素数的序号,将素数连同他的倍
数一起置为它的素数序号,从小到大循环,这样数组里存放的序号就
是最大素数因子的序号了。
注意:初始化时令所有数为0,Prime[0] = Prime[1] = 1。
即Prime[i]为0是素数,Prime[i]为1为素数。改变之后Prime[i]为数i
的最大...
分类:
其他好文 时间:
2014-12-07 00:11:24
阅读次数:
178
Maximal RectangleGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.如果用DP来做,判断(begin...
分类:
其他好文 时间:
2014-12-06 16:44:58
阅读次数:
166
Largest Rectangle in HistogramGivennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of l...
分类:
其他好文 时间:
2014-12-06 16:39:46
阅读次数:
139
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-12-06 15:19:13
阅读次数:
199
Largest prime factor
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7195 Accepted Submission(s): 2554
Problem Description
Eve...
分类:
其他好文 时间:
2014-12-05 21:21:41
阅读次数:
226
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.public class Solution { public...
分类:
其他好文 时间:
2014-12-03 22:43:28
阅读次数:
191