http://acm.hdu.edu.cn/showproblem.php?pid=4821
昨晚卡了很久,开始TLE,然后优化了之后,因为几个地方变量写混,一直狂WA,搞得我昨晚都失眠了,,,
这几次hash军写错的变量--tmp=(j==m-1)?ah[j]:(ah[j]-ah[j-m]*base[m]); 外层循环变量是i,我写的字符串hash的几题都写成tmp=(i==0)?ah[j...
分类:
其他好文 时间:
2014-08-11 10:10:42
阅读次数:
245
代码如下(主要是通过设置Location的hash属性):无标题文档页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容页面内容...
分类:
Web程序 时间:
2014-08-11 10:02:31
阅读次数:
188
解题报告
题意:
一根长度8000的线段上染色,求染完之后,每个颜色在线段上有多少个间断的区间。
思路:
区间问题用线段树,成段的更新区间,最后把所有的区间下压到叶子结点,统计叶子结点的颜色。
#include
#include
#include
using namespace std;
int lz[32000],_hash[10000],color[10000],cnt;
v...
分类:
其他好文 时间:
2014-08-11 06:19:21
阅读次数:
258
1078. Hashing (25)
时间限制
100 ms
内存限制
32000 kB
代码长度限制
16000 B
判题程序
Standard
作者
CHEN, Yue
The task of this problem is simple: insert a seq...
分类:
其他好文 时间:
2014-08-11 00:24:21
阅读次数:
206
解题报告
题意:
求逆序数。
思路:
线段树离散化处理。
#include
#include
#include
#include
#define LL long long
using namespace std;
LL sum[2001000],num[501000],_hash[501000];
void push_up(int rt)
{
sum[rt]=sum[rt...
分类:
其他好文 时间:
2014-08-11 00:22:01
阅读次数:
255
poj1200:http://poj.org/problem?id=1200题意:给你一个有m种字符串,求长度为n的连续子串由多少种。题解:网上的代码都是hash,但是本人觉得hash有问题,就是n,m稍微大点,hash的值都会爆出int,无法开数组来记录该串是否被记录。可能数据弱,结果hash竟然...
分类:
其他好文 时间:
2014-08-10 23:58:00
阅读次数:
559
hdu1880:http://acm.hdu.edu.cn/showproblem.php?pid=1880题意:中文题,直接看题。题解:第一法用hash做的的题目。虽然用了很长时间,但是还是AC了。而且用了string 所以有点慢。 1 #include 2 #include 3 #include...
分类:
其他好文 时间:
2014-08-10 23:49:40
阅读次数:
300
首先该DEMO在StreamCoder上面做的改动,期间导致StreamCoderDEMO经常出现问题,导致大家运行的时候,频频出现问题,表示道歉。以下是测试的结果,从服务器下载传输了一个3G左右的文件(Win7.iso)。传输后用Hash工具做了个测试,是一样的。后面贴出了两个文件的贴图。下面是客...
分类:
其他好文 时间:
2014-08-10 21:29:10
阅读次数:
281
#include #include #include #include #include #include using namespace std;struct node{ int m,n; // bool f;};node hash[200];char s[1000];int main(...
分类:
其他好文 时间:
2014-08-10 21:10:11
阅读次数:
345