peltorator

Atomic HashSet

Apr 18th, 2019
177
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <ext/pb_ds/assoc_container.hpp>
  2. using namespace __gnu_pbds;
  3. gp_hash_table<int, int> table;
  4.  
  5. ----------------------------------------------
  6.  
  7.  
  8. const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
  9. struct chash {
  10.     int operator()(int x) const { return x ^ RANDOM; }
  11. };
  12. gp_hash_table<key, int, chash> table;
RAW Paste Data