diff options
| author | MZuenni <michi.zuendorf@gmail.com> | 2024-08-13 17:14:17 +0200 |
|---|---|---|
| committer | MZuenni <michi.zuendorf@gmail.com> | 2024-08-13 17:14:17 +0200 |
| commit | f32a00178f0d3b2152a6fc1dc492c987aaede85f (patch) | |
| tree | fbc52e3475de069ed8b63513f98105bbc0728d6c /content/datastructures/pbds.cpp | |
| parent | 6fd4266de544582c0609a2fa204e0e49cd390c6e (diff) | |
small improvements
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 f0889a2..de0ace6 100644 --- a/content/datastructures/pbds.cpp +++ b/content/datastructures/pbds.cpp @@ -6,11 +6,11 @@ using Tree = tree<T, null_type, less<T>, rb_tree_tag, // T.order_of_key(x): number of elements strictly less than x // *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>>; |
