LeetCode: Maximal RectangleGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.地址:htt...
分类:
其他好文 时间:
2014-09-03 22:36:37
阅读次数:
220
LeetCode: Largest Rectangle in HistogramGiven n non-negative integers representing the histogram's bar height where the width of each bar is 1, find t...
分类:
其他好文 时间:
2014-09-03 22:35:37
阅读次数:
291
letshabiNumbers=["prime":[2,3,5,7,11,13],"Fibonacci":[1,1,2,3,4,8],"Square":[1,4,9,16,25],]varlargest=0varbigerkind=0vartemp=0vartag=1;vari=0;vars=""for(kind,numbers)inshabiNumbers{/*fornumberinnumbers{ifnumber>largest{largest=number}}*/fornumberinnumber..
分类:
编程语言 时间:
2014-09-01 15:54:43
阅读次数:
173
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,...
分类:
其他好文 时间:
2014-08-31 15:49:11
阅读次数:
180
UVA 11324 - The Largest Clique
题目链接
题意:给定一个有向图,要求找一个集合,使得集合内任意两点(u, v)要么u能到v,要么v能到u,问最大能选几个点
思路:强连通分量,构造出scc之后,缩点,每个点的权值是集合点个数,然后做一遍dag找出最大权值路径即可
代码:
#include
#include
#include
#incl...
分类:
其他好文 时间:
2014-08-30 13:55:39
阅读次数:
196
这篇博客的目的是为了提醒自己,以后笔试一定得及时交啊?!!!!
阿里笔试的最后一个题,我顺手就写python实现,代码如下,不知道对不对,反正当时好几个数据都过了。
不过,反正没交上去,那个题填代码的地方是空的,对错都没用了。先记下,改天细究:
def largest_common(query, text, is_first_same):
if (len(query) == 0 or...
分类:
编程语言 时间:
2014-08-29 21:26:08
阅读次数:
297
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,...
分类:
其他好文 时间:
2014-08-29 01:18:46
阅读次数:
187
#include #include #include using namespace std;int a[100100],q[100100],l[100100],r[100100];int main(){ int i,n,cnt; while(scanf("%d",&n),n!=0) ...
分类:
其他好文 时间:
2014-08-28 22:34:16
阅读次数:
224
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...
分类:
其他好文 时间:
2014-08-26 22:44:46
阅读次数:
212
//堆排序//①维护堆 void max_heapify(int *ptr,int index,int len){ index = index + 1; int left = index ptr[index - 1]) largest = left; if(righ...
分类:
其他好文 时间:
2014-08-26 11:19:16
阅读次数:
186