Skip to content

Instantly share code, notes, and snippets.

@sudo-panda
Created August 11, 2020 16:54
Show Gist options
  • Select an option

  • Save sudo-panda/d6351a3ac72faadefafb05bbf63916d3 to your computer and use it in GitHub Desktop.

Select an option

Save sudo-panda/d6351a3ac72faadefafb05bbf63916d3 to your computer and use it in GitHub Desktop.
C++ tips to get around TLE : hash function
struct HASH {
size_t operator()(const std::pair<int,int> &p) const {
return ~p.first ^ p.second; // the first is negated to differentiate between mirrored pairs
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment