DimmyT's blog

By DimmyT, history, 8 years ago, translation, In English

On task 977F - Consecutive Subsequence I have a TL on solution with unordered_map 37945413 but exactly the same solution with map instead of unordered_map 37989920 I have passed. This is not an error because unordered_map faster map, right?

UPD: I just translated to Eng

UPD1:

Everything about unordered_map:

https://mirror.codeforces.com/blog/entry/62393

https://mirror.codeforces.com/blog/entry/21853

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

»
6 years ago, hide # |
Rev. 2  
Vote: I like it -35 Vote: I do not like it

Why so much dislikes?

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

Good amount of discussion on this same topic can be found here. Read all comments.

»
6 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

The worst case time complexity of operation in unordered_map is O(n) rather than the expected O(1),moreover the complexity of unordered_map is amortised O(1) ,whereas for map is O(log n). Similar thing had happened to me earlier.