![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
哈希
REXWind_W
这个作者很懒,什么都没留下…
展开
-
洛谷P3370 【模板】字符串哈希 题解(写了一个双哈希)
https://www.luogu.com.cn/problem/P3370看了一下这题的题解,发现好像直接用单哈希就可以写。。对每个字符串计算两个字符串哈希值,分别取不同的模数,做一对pair分别储存对两个模数的哈希值。之后只需要对这些pair进行排序,找有多少个不同的就可以了。#include<iostream>#include<algorithm> using namespace std;int cansel_sync=(ios::sync_with_stdio(原创 2020-08-17 17:52:19 · 379 阅读 · 0 评论 -
HDOJ 6768 The Oculus (哈希) (杭电多校2020第二场1006) 题解
http://acm.hdu.edu.cn/showproblem.php?pid=6768思路:因为数据的范围1≤∣A∣,∣B∣≤1000000.1≤|A|,|B|≤1000000.1≤∣A∣,∣B∣≤1000000.2≤∣C∣≤∣A∣+∣B∣+1.2≤|C|≤|A|+|B|+1.2≤∣C∣≤∣A∣+∣B∣+1.∑∣A∣,∑∣B∣≤5000000.∑|A|,∑|B|≤5000000.∑∣A∣,∑∣B∣≤5000000.给的有点大,所以我们找一个模数,这个数应该满足,在fb(1)到f原创 2020-07-24 19:46:37 · 221 阅读 · 1 评论