Skip to content

Commit

Permalink
Add operator< and operator== to Hashing-codeforces
Browse files Browse the repository at this point in the history
  • Loading branch information
simonlindholm committed Sep 10, 2022
1 parent 8274869 commit ca294f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/strings/Hashing-codeforces.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ struct A {
A operator-(A o){int y = x-o.x; return{y + (y< 0)*M, b-o.b};}
A operator*(A o) { return {(int)(1LL*x*o.x % M), b*o.b}; }
explicit operator ull() { return x ^ (ull) b << 21; }
bool operator==(A o) const { return (ull)*this == (ull)o; }
bool operator<(A o) const { return (ull)*this < (ull)o; }
};
typedef A<1000000007, A<1000000009, unsigned>> H;

Expand Down

0 comments on commit ca294f4

Please sign in to comment.