Why using unordered_map gives TLE and how to spot it?

Revision en1, by noobnocap, 2024-10-28 15:15:29

Unorded_map lets us access any element in O(1). So unordered_map is very handy for some problems. But sometimes it gives TLE as the worst case time is o(n). How to spot it beforehand and know the hash function will generate heavy collisions?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English noobnocap 2024-10-28 15:15:29 294 Initial revision (published)