From 5ab8a5088b729a9953b8dff1b2a985dc8fb2098b Mon Sep 17 00:00:00 2001 From: mzuenni Date: Mon, 27 Jun 2022 17:19:28 +0200 Subject: updated tcr --- datastructures/stlHashMap.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 datastructures/stlHashMap.cpp (limited to 'datastructures/stlHashMap.cpp') diff --git a/datastructures/stlHashMap.cpp b/datastructures/stlHashMap.cpp new file mode 100644 index 0000000..b107dde --- /dev/null +++ b/datastructures/stlHashMap.cpp @@ -0,0 +1,17 @@ +#include +using namespace __gnu_pbds; + +template +struct betterHash { + size_t operator()(T o) const { + size_t h = hash()(o) ^ 42394245; //random value + h = ((h >> 16) ^ h) * 0x45d9f3b; + h = ((h >> 16) ^ h) * 0x45d9f3b; + h = ((h >> 16) ^ h); + return h; +}}; + +template> +using hashMap = gp_hash_table; +template> +using hashSet = gp_hash_table; -- cgit v1.2.3