Advertisement
peltorator

Atomic HashSet

Apr 18th, 2019
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement