diff options
Diffstat (limited to 'content/datastructures/pbds.cpp')
| -rw-r--r-- | content/datastructures/pbds.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/content/datastructures/pbds.cpp b/content/datastructures/pbds.cpp index d00b635..734bf91 100644 --- a/content/datastructures/pbds.cpp +++ b/content/datastructures/pbds.cpp @@ -15,10 +15,10 @@ using Tree = tree<T, null_type, less<T>, rb_tree_tag, T.order_of_key(x); // number of elements strictly less than x auto it = T.find_by_order(k); // k-th element +constexpr uint64_t RNG = ll(2e18 * acos(-1)) | 199; // random odd template<typename T> struct chash { - static const uint64_t C = ll(2e18 * acos(-1)) | 199; // random odd size_t operator()(T o) const { - return __builtin_bswap64(hash<T>()(o) * C); + return __builtin_bswap64(hash<T>()(o) * RNG); }}; template<typename K, typename V> using hashMap = gp_hash_table<K, V, chash<K>>; |
