题目
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.
方法
使用两个矩阵,分别记录每一行连续的1的个数以及每一列连续的1的个数。
public int maximalRec...
分类:
其他好文 时间:
2014-06-11 00:24:51
阅读次数:
343
题目
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.
Above is a histogram w...
分类:
其他好文 时间:
2014-06-10 15:34:02
阅读次数:
252
问题: cannot find -lnlcollect2: error: ld returned 1 exit statusmake: *** [wpa_supplicant] 错误 1解决方法:[fulinux@ubuntu wpa_supplicant]$ sudo apt-get install libnl-dev libssl-dev...
分类:
其他好文 时间:
2014-06-10 13:35:36
阅读次数:
262
find . -name "*.lastUpdated" -exec rm -rf {}
\;这个命令是find的基本用法,可以分两部分,find ~/ -name "*.aic"和 -exec rm -rf {} \; ~/:在根目录下查找
-name 查找文件名的方式 "*.aic"文件名中要求...
分类:
系统相关 时间:
2014-06-10 12:47:20
阅读次数:
245
1 class Solution { 2 public: 3 int
singleNumber(int A[], int n) { 4 int i,j; 5 for(i=0; i<n; i++) 6 { 7 for(j...
分类:
移动开发 时间:
2014-06-10 11:41:55
阅读次数:
259
题目描述:
Write a function to find the longest common prefix string amongst an
array of strings.
很简单的一道题目,但是我写了两个不一样的版本,运行时间确实数倍之差。。贴代码如下:
版本1:
{CSDN:CODE:384511}
这个版本的运行时间为 44 ms...
分类:
其他好文 时间:
2014-06-10 08:18:58
阅读次数:
291
binary search\sort\find operations
status InsertNode(Node* root, data x, Node* father)
{
if(root==NULL)
{
if(father==NULL)
Tree empty;
else
{
if(xdata)
{
father->left=new Node//inital l...
分类:
其他好文 时间:
2014-06-10 08:09:49
阅读次数:
234
try{
String cmds="java -version";
Process p = Runtime.getRuntime().exec(cmds);
int exitValue = 1;
if((exitValue = p.waitFor()) != 0)
{
p.destroy();
System.out.println("exitValue:"+exitValue);
...
分类:
编程语言 时间:
2014-06-10 07:57:42
阅读次数:
341
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant...
分类:
其他好文 时间:
2014-06-10 07:42:16
阅读次数:
244
题目:
链接:点击打开链接
思路:
对边排序,再枚举每条边,如果出现通路(findset(x) == findset(y))就结束。
代码:
#include
#include
#include
#include
using namespace std;
#define MAXN 220
#define MAXM 1010
#define MAX ...
分类:
其他好文 时间:
2014-06-10 07:34:46
阅读次数:
237