C++ STL map vs unordered_map

Revision en1, by dumbguy, 2017-12-24 09:52:56

Hello guys,
Since a long time i was under the impression that STL unordered_map is faster due to its non ordering than STL map.
But in a problem when i submitted the solution using unordered_map i got TLE but with map i got AC.
Can anyone please provide an insight into this because i am not able to understand why this happened for this particular solution.

For reference, this is the solution using unordered_map : 33578534 and this one using map : 33578782.
This is the actual problem 776C - Molly's Chemicals
.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English dumbguy 2017-12-24 09:52:56 591 Initial revision (published)