We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41bbc3d commit 6399b65Copy full SHA for 6399b65
string/rolling_hash_1d.hpp
@@ -97,6 +97,11 @@ template <typename V> struct rolling_hash {
97
return length == r.length and val == r.val;
98
}
99
100
+ bool operator<(const Hash &x) const { // To use std::map
101
+ if (length != x.length) return length < x.length;
102
+ return val < x.val;
103
+ }
104
+
105
Hash operator*(const Hash &r) const {
106
return Hash(length + r.length, val * power.at(r.length) + r.val);
107
0 commit comments