原题地址:https://oj.leetcode.com/problems/rotate-image/题意:You
are given annxn2D matrix representing an image.Rotate the image by 90 degrees
(clockwise).Fo...
分类:
编程语言 时间:
2014-06-11 09:43:59
阅读次数:
1264
题目
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
简单字符串。 1 #include 2 #include 3 4 #define MAXLEN 105
5 #define MAXN 25 6 7 char keys[MAXN][MAXN]; 8 char lines[MAXN][MAXLEN]; 9 int
nums[MAXN];10...
分类:
其他好文 时间:
2014-06-09 19:29:31
阅读次数:
190
kmp算法。 1 #include 2 #include 3 4 char
src[10005], des[1000005]; 5 int next[10005], total; 6 7 void kmp(char des[],
char src[]){ 8 int ld = str...
分类:
其他好文 时间:
2014-06-09 17:46:37
阅读次数:
264
这部分 cover 两个比较特殊的情形,一个是 Gaussian networks,一个是
exponential family。正态分布常见的参数化策略是均值 和协方差矩阵 ,另一种是使用 information matrix/precision
matrix,即 ,另可以用所谓 potenti....
分类:
其他好文 时间:
2014-06-08 23:10:53
阅读次数:
296
01背包。 1 #include 2 #include 3 #include 4 5
#define MAXN 1005 6 7 typedef struct { 8 int h, l, t; 9 } node_st;10 11 node_st
nodes[35];12 13 in...
分类:
其他好文 时间:
2014-06-08 22:44:08
阅读次数:
339
写了个函数指针,这题目很水,但是佷烦。 1 #include 2 #include 3
#include 4 #include 5 using namespace std; 6 7 #define MAXN 305 8 9 typedef
struct {10 int id, g...
分类:
其他好文 时间:
2014-06-08 20:55:48
阅读次数:
202
Spiral MatrixGiven a matrix of m x n elements
(m rows, n columns), return all elements of the matrix in spiral order.For
example, Given the following ...
分类:
其他好文 时间:
2014-06-07 22:57:31
阅读次数:
236
You are given an n x n 2D matrix representing
an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this
in-place?实现题。从最外圈顺时针交换,最...
分类:
其他好文 时间:
2014-06-07 20:33:17
阅读次数:
283