题目大意:
n*m的矩阵中,有多少个子矩阵不是同的。
思路分析:
假设这题题目只是一维的求一个串中有多少个子串是不同的。
那么也就是直接扫描height,然后减去前缀。
现在变成二维,如何降低维度。
知道hash 的作用就是将一个串映射到一个数字。
那我们就将这个矩阵hash,考虑到不同的长度和宽度都会导致不同,
所以就要枚举子矩阵的宽度。
hash [i][j]...
分类:
其他好文 时间:
2014-08-04 17:40:37
阅读次数:
260
有三样东西对AJAX驱动的单页应用很关键:时间委托、历史管理和通信模式(Pub/Sub)。 首先让我们介绍一下Pub/Sub是个什么东西。我们可以把这个东西叫做广播,大概的意思就是当你发布了一个东西,那么其他的人就都...
分类:
Web程序 时间:
2014-08-03 20:45:56
阅读次数:
314
先上题目:Good Luck in CET-4 Everybody!Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5113Accepted Sub...
分类:
其他好文 时间:
2014-08-02 23:24:44
阅读次数:
203
It is all about corner cases.class Solution {public: vector retv; bool isValid(string &sub) { unsigned cnt = sub.length(); if (...
分类:
其他好文 时间:
2014-08-02 12:39:03
阅读次数:
220
QuickSortIn the previous challenge, you wrote a partition method to split an array into 2 sub-arrays, one containing smaller elements and one containi...
分类:
其他好文 时间:
2014-08-02 12:12:53
阅读次数:
512
1.MFC下生成动态库1>显式调用在.cpp文件里添加接口函数1 int sum(int a,int b)2 {3 return a + b;4 }5 6 int sub(int a,int b)7 {8 return a - b;9 }在.def文件里标示导出接口1 sum @1;...
Public Class frmDl Dim x As Single = 0 Dim y As Single = 0 Private Sub frmDl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ...
Computer Virus on Planet PandoraTime Limit: 6000/2000 MS (Java/Others)Memory Limit: 256000/128000 K (Java/Others)Total Submission(s): 2578Accepted Sub...
分类:
Web程序 时间:
2014-07-31 13:14:26
阅读次数:
450
#include
sub(int *a,int n,int k)
{
if(k<=n)sub(a,n/2,2*k);
*a+=k;
}
main()
{
int x=0;
sub(&x,8,1);
printf("%d\n",x);
}...
分类:
其他好文 时间:
2014-07-31 09:52:06
阅读次数:
205
DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or greater locat...
分类:
其他好文 时间:
2014-07-31 02:38:55
阅读次数:
292