题目: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...
分类:
其他好文 时间:
2015-10-08 12:59:14
阅读次数:
193
E-pang Palace was built in Qin dynasty by Emperor Qin Shihuang in Xianyang, Shanxi Province. Itwas the largest palace ever built by human. It was so l...
分类:
其他好文 时间:
2015-10-07 20:22:46
阅读次数:
231
#include using namespace std;void Maxheap(int *a,int i,int heapSize)//最大数调整{ int left=i*2+1;//i的左节点 int right=i*2+2; int largest;//中间变量 if...
分类:
编程语言 时间:
2015-10-07 18:47:38
阅读次数:
204
题目链接:http://poj.org/problem?id=2559求所给柱状图内面积最大的矩形。用了一个叫做单调栈的玩意,思路很像DP,就是每一个柱看作一个结构体,保存当前柱的高度以及它之前(左侧)所能到达的最大横坐标距离,且只有满足条件的时候才会入栈。 1 #include 2 #inclu....
分类:
其他好文 时间:
2015-10-06 15:23:41
阅读次数:
126
The United Nations has decided to build a new headquarters in Saint Petersburg, Russia. It will have a form of a rectangular parallelepiped and will c...
分类:
其他好文 时间:
2015-10-05 21:58:56
阅读次数:
281
Problem:Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.Fo...
分类:
其他好文 时间:
2015-10-01 09:14:31
阅读次数:
227
Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampl...
分类:
其他好文 时间:
2015-10-01 06:57:42
阅读次数:
202
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matr...
分类:
其他好文 时间:
2015-09-29 06:31:46
阅读次数:
173
Problem B: The Largest CliqueGiven a directed graphG, consider the following transformation. First, create a new graphT(G)to have the same vertex set ...
分类:
其他好文 时间:
2015-09-25 11:05:24
阅读次数:
180
Largest PointTime Limit: 1500/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 536 Accepted Submission(s): 230Probl...
分类:
其他好文 时间:
2015-09-24 14:17:35
阅读次数:
216