11 size_t num_bases = 1,
size_t CACHE = 1'000'000>
15 constexpr array<typename mint::umod_type, num_bases>
get_v()
const {
16 array<typename mint::umod_type, num_bases> res;
17 for (
int i = 0; i < num_bases; i++) {
25 for (
int i = 0; i < num_bases; i++) {
26 res.v[i] += get_pow(i, a) * cnt;
33 for (
int i = 0; i < num_bases; i++) {
34 res.v[i] -= get_pow(i, a) * cnt;
42 for (
int i = 0; i < num_bases; i++) {
43 res.v[i] *= get_pow(i, delta);
52 for (
int i = 0; i < num_bases; i++) {
62 for (
int i = 0; i < num_bases; i++) {
68 for (
int i = 0; i < num_bases; i++) {
80 array<mint, num_bases> v;
81 inline static const array<mint, num_bases>
84 inline static const array<array<mint, CACHE>, num_bases>
88 constexpr mint get_pow(
int i,
long long p)
const {
89 assert(i < num_bases);
91 return p >= 0 ? bases_pow[i][p] : inv_bases_pow[i][-p];
93 return p >= 0 ? bases[i].pow(p) : inv_bases[i].pow(-p);
constexpr array< mint, num_bases > gen_inverse(const array< mint, num_bases > &bases)
Definition hashing.hpp:25
constexpr array< mint, num_bases > gen_bases()
Definition hashing.hpp:16
constexpr array< array< mint, CACHE >, num_bases > init_power(const array< mint, num_bases > &bases)
Definition hashing.hpp:34
Definition multiset_hash.hpp:12
constexpr MultisetHash insert(long long a, long long cnt=1) const
Definition multiset_hash.hpp:23
modint mint
Definition multiset_hash.hpp:13
constexpr MultisetHash offset(long long delta) const
Definition multiset_hash.hpp:40
constexpr bool operator!=(const MultisetHash &o) const
Definition multiset_hash.hpp:75
constexpr bool operator==(const MultisetHash &o) const
Definition multiset_hash.hpp:67
constexpr MultisetHash erase(long long a, long long cnt=1) const
Definition multiset_hash.hpp:31
constexpr MultisetHash operator-(const MultisetHash &o) const
Definition multiset_hash.hpp:57
constexpr MultisetHash operator+(const MultisetHash &o) const
Definition multiset_hash.hpp:47
constexpr MultisetHash & operator+=(const MultisetHash &o)
Definition multiset_hash.hpp:51
constexpr array< typename mint::umod_type, num_bases > get_v() const
Definition multiset_hash.hpp:15
constexpr MultisetHash & operator-=(const MultisetHash &o)
Definition multiset_hash.hpp:61