Commit 52596d6b authored by Horace He's avatar Horace He

unify constants used in hashmap.h

parent d373a1a7
......@@ -20,7 +20,7 @@ __gnu_pbds::gp_hash_table<ll,int,chash> h({},{},{},{},{1<<16});
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash { // To use most bits rather than just the lowest ones:
const uint64_t C = ll(2e18 * acos(-1.0)) | 71; // large odd number
const uint64_t C = ll(4e18 * acos(0)) | 71; // large odd number
ll operator()(ll x) const { return __builtin_bswap64((x^RANDOM)*C); }
};
__gnu_pbds::gp_hash_table<ll, int, chash> h({},{},{},{}, {1 << 16});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment