算法题 手写实现字符串哈希
题目来源:https://www.acwing.com/problem/content/843/
C++
#include <iostream>
using namespace std;
typedef unsigned long long ULL;
const int N = 1e5+10, P = 131; # 根据经验得到,不容易冲突的质数
int n, m;
int h[N], p[N];
char str[N];
ULL get(int l, int r){
re
原创
2020-11-25 21:49:02 ·
264 阅读 ·
0 评论