Adibov's blog

By Adibov, history, 7 years ago, In English

What's wrong with unordered_map? Shouldn't be faster than map? I just submitted two solution with map and unordered_map and first one got TLE while second one got ACC. Could you please say why?

TLE: 48262291

ACC: 48262284

Even i reserved it: 48262508

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
7 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

This might help :) The search time for an unordered map is of O(n) in the worst case.

»
7 years ago, hide # |
Rev. 2  
Vote: I like it +1 Vote: I do not like it

You can use gp_hash_table. I modified your solution and got AC in 2700ms.