![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串哈希
mumei314
这个作者很懒,什么都没留下…
展开
-
CCPC2019哈尔滨站L题——单哈希+模拟
题目链接:https://codeforces.com/gym/102394/problem/L题目大意:给你一个长度为n的序列,即执行序列,然后给你qu次查询操作,每次给你一个m值,即内存大小,以及一个长度为m的序列状态,然后让你判断在执行LRU算法(在内存大小为m)时是否会出现该序列状态。题解:比赛最后一个小时开的这个题,当时想着先暴力一下,之后再找个什么优化,结果暴力...原创 2020-02-25 11:52:57 · 502 阅读 · 0 评论 -
POJ2752——经典哈希(公共前缀后缀长度)
题目链接:poj.org/problem?id=2752The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name...原创 2019-08-13 12:18:36 · 307 阅读 · 0 评论 -
SCU4438——经典哈希+前缀和
题目链接:http://acm.scu.edu.cn/soj/problem.action?id=4438Censorfrog is now a editor to censor so-called sensitive words (敏感词).She has a long text pp. Her job is relatively simple -- just to fi...原创 2019-08-13 12:21:58 · 5372 阅读 · 0 评论 -
hdu1496——哈希妙用(暴力+优化)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1496Consider equations having the following form:a*x1^2+b*x2^2+c*x3^2+d*x4^2=0a, b, c, d are integers from the interval [-50,50] and any of them cann...原创 2019-08-13 12:24:39 · 224 阅读 · 0 评论 -
字符串哈希总结
昨天做了学长拉的字符串哈希的专题,今天便来做个总结吧。哈希是数据结构里面的内容,其实就是把字符串编个号,用数字来表示,这样查询和判断相同时就方便了许多。但是编的这个号也是有很关键,我们需要尽可能的保证不同字符串的编号不会相等,即冲突概率为0.一个关键的定理:哈希值相等的字符串不一定相等,字符串相等的哈希值一定相等。因此我们需要尽可能减少第一种情况。在处理子串问题时,我们一般采用前缀...原创 2019-08-13 12:29:16 · 1142 阅读 · 0 评论 -
POJ3461——经典哈希(求可重叠串个数)
题目链接:http://poj.org/problem?id=3461The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:...原创 2019-08-13 12:10:03 · 140 阅读 · 0 评论 -
hdu1880——哈希+恶心输入输出
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1880哈利波特在魔法学校的必修课之一就是学习魔咒。据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔咒,所以他需要你的帮助。给你一部魔咒词典。当哈利听到一个魔咒时,你的程序必须告诉他那个魔咒的功能;当哈利需要某个功能但不知道该用什么...原创 2019-08-13 10:26:54 · 221 阅读 · 2 评论 -
POJ1743——哈希+二分(后缀数组SA)
题目链接:http://poj.org/problem?id=1743A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfor...原创 2019-08-13 10:38:51 · 200 阅读 · 0 评论 -
POJ2406——经典哈希(求最大循环次数)
题目链接:poj.org/problem?id=2406Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplica...原创 2019-08-13 12:14:57 · 556 阅读 · 0 评论