哈希表
nike0good
这个作者很懒,什么都没留下…
展开
-
ELF hash
字符串Hash 模板代码unsigned long elf_hash(const unsigned char *name) { unsigned long h = 0, g; while (*name) { h = (h << 4) + *name++; if (g = h & 0xf0000000转载 2012-07-26 18:40:41 · 747 阅读 · 0 评论 -
BZOJ 3097(Hash Killer I-哈希%u64的不可行)
3097: Hash Killer ITime Limit: 5 Sec Memory Limit: 128 MBSec Special JudgeSubmit: 76 Solved: 34[Submit][Status][Discuss]Description这天天气不错,hzhwcmhf神犇给VFleaKing出了一道题:给你一个长度为N的字符串S,求有多少个原创 2013-04-07 21:34:33 · 2643 阅读 · 0 评论 -
BZOJ 3198([Sdoi2013]spring-Hash判重+容斥原理)
3198: [Sdoi2013]springTime Limit: 40 Sec Memory Limit: 256 MBSubmit: 104 Solved: 42[Submit][Status][Discuss]DescriptionInputOutputSample Input3 31 2 3 4 5 6原创 2013-06-24 17:36:16 · 2111 阅读 · 0 评论 -
BZOJ 2242([SDOI2011]计算器-Baby Step Giant Step第1题)
2242: [SDOI2011]计算器Time Limit: 10 Sec Memory Limit: 512 MBSubmit: 744 Solved: 289[Submit][Status]Description你被要求设计一个计算器完成以下三项任务:1、给定y,z,p,计算Y^Z Mod P 的值;2、给定y,z,p,计算满足xy≡ Z ( mod P )原创 2013-06-25 16:41:08 · 2241 阅读 · 0 评论 -
CF 518C(Anya and Smartphone-映射)
C. Anya and Smartphonetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnya has bought a new smartphone that原创 2015-02-25 15:23:26 · 1181 阅读 · 0 评论 -
LA 4513(Stammering Aliens-Hash求LCP)[Template:hash求LCP]
4513 - Stammering AliensDr. Ellie Arroway has established contact with an extraterrestrial civilization. However, all efforts to decode their messages have failed so far because, as luck would have原创 2015-03-25 16:33:49 · 1376 阅读 · 0 评论 -
BestCoder Round #36(Gunner-hash)
GunnerAccepts: 391Submissions: 1397Time Limit: 8000/4000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)问题描述很久很久以前,有一个叫Jack的枪手。他非常喜欢打猎。一天,他去了一个小树林。那儿有只鸟,还有n 棵树。第i 只鸟站原创 2015-04-05 09:15:35 · 932 阅读 · 0 评论 -
POJ 3690(Constellations-矩阵hash)
在一个n*m的矩阵里查t个p*q的子矩阵是否存在。 (1 ≤ N, M ≤ 1000, 1 ≤ T ≤ 100, 1 ≤ P, Q ≤ 50)矩阵hash,写精简一点(我的代码不精简), 要在map里放N*M个矩阵为TLE, 所以在map里放t个子矩阵#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>原创 2016-05-02 11:30:06 · 808 阅读 · 0 评论 -
CF 869E(The Untended Antiquity-Hash值维护连通性)
一个地图,然后三种操作 1.一个矩阵四周加上障碍 (不与任何障碍相交) 2.一个矩阵四周的障碍消除 3.问你两个点之间是否纯在一条路径不经过障碍 矩阵大小2500^2,操作10w树状数组 考虑每次操作定一个hash值,然后每次在那个矩阵上xor那个hash值,问题转化为2点hash值是否相同。#include<bits/stdc++.h> using namespa原创 2017-10-08 11:22:54 · 484 阅读 · 0 评论