MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / hash

Method hash

code/strings/hasher.cpp:7–8  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5 rep(i,0,size(s)) p[i+1] = (ll)p[i] * b % m;
6 rep(i,0,size(s)) h[i+1] = ((ll)h[i] * b + s[i]) % m; }
7 int hash(int l, int r) {
8 return (h[r+1] + m - (ll)h[l] * p[r-l+1] % m) % m; } };
9// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected