Created
August 11, 2020 16:54
-
-
Save sudo-panda/d6351a3ac72faadefafb05bbf63916d3 to your computer and use it in GitHub Desktop.
C++ tips to get around TLE : hash function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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