Is tr1::unordered_map better than a regular hash table [C++]?

Revision en1, by infinitepro, 2019-12-31 15:07:12

I was solving 877F today. My code kept TLE'ing on TC #11 while using both map<> and unordered_map<>. While skimming through the accepted solutions, I stumbled on this solution, which is exactly similar to my solution, but uses tr1::unordered_map<> instead of the regular std::unordered_map<>.

Unsurprisingly, changing my code to tr1::unordered_map<> gives an AC.

Now, I have some questions.

  • Is this relatively unknown implementation better than the regular unordered_map?
  • Can this ds be hacked similar to how unordered_map is hacked? If yes, how?
  • Are all the other variants like tr1::set<>, tr1::unordered_set<> etc better than the regular ones?


  Rev. Lang. By When Δ Comment
en1 English infinitepro 2019-12-31 15:07:12 1090 Initial revision (published)